JSPM

  • Created
  • Published
  • Downloads 11383018
  • Score
    100M100P100Q334695F
  • License MIT

Inquirer rawlist prompt

Package Exports

  • @inquirer/rawlist
  • @inquirer/rawlist/index.js

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

Readme

@inquirer/rawlist

Simple interactive command line prompt to display a raw list of choices (single value select) with minimal interaction.

rawlist prompt

Installation

npm install @inquirer/rawlist

yarn add @inquirer/rawlist

Usage

import rawlist from '@inquirer/rawlist';

const answer = await rawlist({
  message: 'Select a package manager',
  choices: [
    { name: 'npm', value: 'npm' },
    { name: 'yarn', value: 'yarn' },
    { name: 'pnpm', value: 'pnpm' },
  ],
});

Options

Property Type Required Description
message string yes The question to ask
choices Array<{ value: string, name?: string, key?: string }> yes List of the available choices. The value will be returned as the answer, and used as display if no name is defined. By default, choices will be selected by index. This can be customized by using the key option.

License

Copyright (c) 2022 Simon Boudrias (twitter: @vaxilart) Licensed under the MIT license.