JSPM

inquirer-orderedcheckbox

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 21
  • Score
    100M100P100Q47319F
  • License MIT

An Inquirer extension to allow users to select entries in a list and order the list before processing.

Package Exports

  • inquirer-orderedcheckbox

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-orderedcheckbox) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

inquirer-orderedcheckbox

Inquirer extension that allows a list to be ordered and selected.

License

The License information is available in license.txt

Installation

npm install --save inquirer-orderedcheckbox

Usage

This prompt is anonymous, meaning you can register this prompt with the type name you please:

inquirer.registerPrompt('orderedcheckbox', require('inquirer-orderedcheckbox'));
inquirer.prompt({
  type: 'orderedcheckbox',
  ...
})

Options

Takes type, name, message, validate, choices properties.

See inquirer readme for meaning of all

Example

inquirer.registerPrompt('directory', require('inquirer-directory'));
inquirer.prompt([
  {
    type: 'orderedCheckbox',
    message: 'Select toppings',
    name: 'toppings',
    choices: [
      {
        name: 'Pepperoni'
      },
      {
        name: 'Ham'
      },
      {
        name: 'Ground Meat'
      },
      {
        name: 'Bacon'
      },
      {
        name: 'Extra cheese'
      }
    ],
    validate: function (answer) {
      if (answer.length < 1) {
        return 'You must choose at least one topping.';
      }
      return true;
    }
  }
]).then(function (answers) {
  console.log(JSON.stringify(answers, null, '  '));
});

###Thanks Thanks to https://github.com/nicksrandall/inquirer-directory for the information on how to produce this plugin.