Inquirer.js wrapper for asking user to select from a list of choices.
Installation
npm install @justinc/choices
Usage
require('@justinc/choices')({ message: 'Make your selection' }).then(answer => {
console.log('You chose:', answer.choice);
});
require('@justinc/choices')({ message: 'Make your selection', choices: ['blue pill', 'red pill'] }).then(answer => {
console.log('You chose:', answer.choice);
});
Object Argument:
- type: See
type
here. (default: 'list'
) - name: See
name
here. (default: 'choice'
) - message: See
message
here. (default: 'Select one of the following'
) - default: See
default
here. (default: `['yes', 'no', 'skip'])