Bluebird wrapper for inquirer.js
There is a bluebird-inquirer,
but it promisify only prompt function, so you can't use new inquirer.Separator()
.
$ npm install inquirer-bluebird --save
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' ]
}];
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>' }
});
const inquirer = require('inquirer-bluebird');
inquirer.prompt(questions)
.then(function(answers) {
//=> { a: '<1|2|3>', b: '<x|y|z>' }
});
MIT © ewnd9