1.0.0 • Published 2 years ago

@developertheexplorer/rawlist v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@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

PropertyTypeRequiredDescription
messagestringyesThe question to ask
choicesArray<{ value: string, name?: string, key?: string }>yesList 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.