prompt-input

Prompt user inputs with styling

Prompt user inputs with styling

$ npm install prompt-input
prompt = require('prompt-input')(/* options */)
 
prompt('What is your name?', function (answer) {
  answer
  // => Whatever user gives 
})

Options:

  • stdin (default process.stdin)
  • stdout (default process.stdout)

You can apply colors and other styles on your questions and/or answers:

prompt = require('prompt-input')
 
prompt('{bold}{yellow}Are you {red}sure?{reset}')
prompt({ name: 'Your name:', age: 'Your age:' }, function (answers) {
 
  answers.name
  // => john 
 
  answers.age
  // => 20 
 
})