Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

inquirer-bluebird

1.0.7 • Public • Published

inquirer-bluebird

Build Status

Bluebird wrapper for inquirer.js

There is a bluebird-inquirer, but it promisify only prompt function, so you can't use new inquirer.Separator().

Install

$ npm install inquirer-bluebird --save

Usage

const questions = [{
  name: 'a',
  type: 'list',
  message: 'pick a number',
  choices: [ '1', '2', '3' ]
}, {
  name: 'b',
  type: 'list',
  message: 'pick a letter',
  choices: [ 'x', 'y', 'z' ]
}];

Before

const inquirer = require('inquirer');
 
new Promise(resolve => {
  inquirer.prompt(questions, function(answers) {
    resolve(answers);
  });  
})
.then(function(answers) {
  //=> { a: '<1|2|3>', b: '<x|y|z>' }
});

Now

const inquirer = require('inquirer-bluebird');
 
inquirer.prompt(questions)
  .then(function(answers) {
    //=> { a: '<1|2|3>', b: '<x|y|z>' }
  });

Related

License

MIT © ewnd9

Keywords

none

Install

npm i inquirer-bluebird

DownloadsWeekly Downloads

874

Version

1.0.7

License

MIT

Last publish

Collaborators

  • avatar