1.0.0 • Published 2 years ago

@developertheexplorer/checkbox v1.0.0

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

@inquirer/checkbox

Simple interactive command line prompt to display a list of checkboxes (multi select).

Checkbox prompt

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

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