@inquirer/rawlist v2.1.6
@inquirer/rawlist
Simple interactive command line prompt to display a raw list of choices (single value select) with minimal interaction.
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. |
theme | See Theming | no | Customize look of the prompt. |
Theming
You can theme a prompt by passing a theme
object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.
type Theme = {
prefix: string;
spinner: {
interval: number;
frames: string[];
};
style: {
answer: (text: string) => string;
message: (text: string) => string;
error: (text: string) => string;
highlight: (text: string) => string;
};
};
License
Copyright (c) 2023 Simon Boudrias (twitter: @vaxilart) Licensed under the MIT license.
12 days ago
22 days ago
25 days ago
25 days ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
8 months ago
8 months ago
7 months ago
8 months ago
8 months ago
6 months ago
11 months ago
11 months ago
12 months ago
1 year ago
12 months ago
1 year ago
12 months ago
12 months ago
12 months ago
12 months ago
11 months ago
12 months ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago