Package Exports
- @inquirer/checkbox
- @inquirer/checkbox/dist/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/checkbox) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@inquirer/checkbox
Simple interactive command line prompt to display a list of checkboxes (multi select).
Installation
npm install @inquirer/checkbox
yarn add @inquirer/checkbox
Usage
import checkbox from '@inquirer/checkbox';
const answer = await checkbox({
message: 'Select a package manager',
choices: [
{ name: 'npm', value: 'npm' },
{ name: 'yarn', value: 'yarn' },
{ name: 'pnpm', value: 'pnpm', disabled: true },
],
});
Options
Property | Type | Required | Description |
---|---|---|---|
message | string |
yes | The question to ask |
choices | Array<{ value: string, name?: string, disabled?: boolean }> |
yes | List of the available choices. The value will be returned as the answer, and used as display if no name is defined. Choices who're disabled will be displayed, but not selectable. |
License
Copyright (c) 2022 Simon Boudrias (twitter: @vaxilart) Licensed under the MIT license.