JSPM

inquirer-ordinal-prompt

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

Inquirer prompt for ordered multiselect choices

Package Exports

  • inquirer-ordinal-prompt

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

Readme

npm version Build

inquirer-ordinal-prompt

Ordinal prompt for inquirer

Installation

npm install --save inquirer inquirer-ordinal-prompt

Usage

inquirer.registerPrompt('ordinal', require('inquirer-ordinal-prompt').default);

inquirer.prompt({
  type: 'ordinal',
  name: 'scripts',
  message: 'Pick scripts to run in order',
  choices: [ 'Build', 'Lint', 'Test' ],
  default: [ 'Build' ]
});

Options

Take type, name, message, choices[, filter, validate, default] properties. default is expected to be an Array of the ordered choices value.

ordinal prompt is mostly the same as checkbox prompt, with slight differences:

  • it doesn't use checked property and instead leverages default as an ordered list of choice values.
  • selecting a choice will show ordinal index instead of filled checkbox.

Example

You can find a running example in demo.js

asciicast