JSPM

inquirer-shortcuts

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 20
  • Score
    100M100P100Q65883F
  • License MIT

Shortcuts for inquirer question types

Package Exports

  • inquirer-shortcuts

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (inquirer-shortcuts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

inquirer-shortcuts

Wraps the inquirer package and adds shortcuts for all question types. This is handy if you only have one prompt or if you use async/await.

prompt

This method remains unchanged from the inquirer package.

inquirer = require("inquirer-shortcuts");

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!"));