inquirer-menu
v1.0.0
Published
wrapper around inquirer for creation a terminal menu with history
Downloads
8
Maintainers
Readme
inquirer-menu
Wrapper around inquirer for creation a terminal menu with history
Install
$ npm install inquirer-menu --save
Usage
const menu = require('inquirer-menu');
const blueMenu = {
message: 'blue-menu',
choices: {
callApi: function() {
console.log('blue-api called');
return;
}
}
};
const redMenu = {
message: 'red-menu',
choices: {
callApi: function() {
console.log('red-api called');
return;
}
}
};
let level = 0;
function createMenu() {
return {
message: 'main-menu level ' + level,
choices: {
setupData: function() {
level++;
console.log('success');
return;
},
blueMenu: blueMenu,
redMenu: redMenu
}
};
};
menu(createMenu)
.then(function() {
console.log('bye');
})
.catch(function(err) {
console.log(err.stack);
});
Related
License
MIT © ewnd9