choices - a helper function for prompting the user with multiple choices

npm install choices
1 downloads in the last day
18 downloads in the last week
50 downloads in the last month


Prompts the user for multiple choice

Choices are displayed in a numbered list, user is prompted with a message to make a choice.


npm install choices


var choices = require('choices');
var options = ['First Option', 'Second option', 'Third option'];
choices('Pick an option', options, function(idx) {
  console.log('You picked ' + options[idx]);
  1: First option
  2: Second option
  3: Third option
Pick an option>> 2
You picked Second option
npm loves you