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

Readme

Keywords

none

Package Sidebar

Install

npm i inquirer-bluebird

Weekly Downloads

79

Version

1.0.7

License

MIT

Last publish

Collaborators

  • ewnd9