list | var inquirer = require('inquirer');
inquirer.prompt([
{
name: 'type',
type: 'list',
message: 'Select your IDE?',
choices: [{ value: 'idea' }, { value: 'pycharm' }]
}
]).then(res => {
console.log(res);
});
| |
input/number | var inquirer = require('inquirer');
inquirer.prompt([
{
name: 'ipt1',
type: 'input',
message: 'Input your keywords?',
}
]).then(res => {
console.log(res);
});
| |
confirm | inquirer.prompt([
{
name: 'ipt1',
type: 'confirm',
message: 'Confirm?',
}
]).then(res => {
console.log(res);
});
| |
rawlist | inquirer.prompt([
{
name: 'input1',
type: 'rawlist',
message: 'Select your IDE?',
choices: [{ name: 'Jetbrain IDEA', value: 'idea' }, { name: 'Python pycharm', value: 'pycharm' }]
}
]).then(res => {
console.log(res);
});
| |
password | inquirer.prompt([
{
name: 'pwd',
type: 'password',
message: 'Input your password?',
}
]).then(res => {
console.log(res);
});
| |