Choices - an API for prompting the user with multiple choices
Choices is an API for prompting the user with multiple-choices.
Choices are displayed in a numbered list, user is prompted with a message and options repeatedly until they make a choice or cancel (q, esc, ctrl+c).
If the user cancels, your callback will receive null as the option index.
npm install choices
var choices = require'choices';var options = 'First Option' 'Second option' 'Third option';choices'Pick an option' optionsconsole.log'You picked ' + optionsidx;;
: First option: Second option: Third optionPick an option>> 2You picked Second option