inquirer-promise
v1.0.0
Published
Promise-based shortcuts for inquirer
Downloads
56,039
Readme
inquirer-promise
Promise wrapper around inquirer
.
prompt
inquirer = require("inquirer-promise");
inquirer.prompt([{type: "input",
name: "animal",
message: "Favorite animal?",
default: "wapiti"}])
.then(results => console.log(results.animal));
question
Ask one question.
inquirer.question({type: "input",
message: "Favorite animal?",
default: "wapiti"})
.then(animal => console.log(animal));
input
inquirer.input("Favorite animal?", {default: "wapiti"})
.then(animal => console.log(animal));
confirm
inquirer.confirm("Is the wapiti your favorite animal?")
.then(answer => console.log(answer));
list
inquirer.list("Favorite animal?", ["cat", "dog", "wapiti"])
.then(animal => console.log(animal));
rawlist
inquirer.rawlist("Favorite animal?", ["cat", "dog", "wapiti"])
.then(animal => console.log(animal));
expand
inquirer.expand("Favorite animal?",
[{key: "c", name: "cat"}
{key: "d", name: "dog"}
{key: "w", name: "wapiti"}])
.then(animal => console.log(animal));
checkbox
inquirer.checkbox("Favorite animals?", ["cat", "dog", "wapiti"])
.then(animals => console.log(animals));
password
inquirer.password("Enter password.")
.then(password => console.log("Don't print passwords!"));