# @developertheexplorer/expand

> Inquirer checkbox prompt

Latest version **1.0.0** (published 2022-05-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @developertheexplorer/expand
pnpm add @developertheexplorer/expand
yarn add @developertheexplorer/expand
bun add @developertheexplorer/expand
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: esm support; no vulnerabilities; high maintenance score; popular repo.

Warnings: low downloads; no types.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-05-13 |
| First published | 2022-05-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21614 |
| Author | Simon Boudrias |
| Maintainers | developertheexplorer |
| Keywords | cli, prompt, command-line, input, inquirer |

## Links

- npm: https://www.npmjs.com/package/@developertheexplorer/expand
- Repository: https://github.com/SBoudrias/Inquirer.js
- Homepage: https://github.com/SBoudrias/Inquirer.js/blob/master/packages/expand/README.md
- Issues: https://github.com/SBoudrias/Inquirer.js/issues
- npm.io page: https://npm.io/package/@developertheexplorer/expand

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^4.1.1
- [figures](https://npm.io/package/figures.md) ^3.0.0
- [@inquirer/core](https://npm.io/package/@inquirer/core.md) ^0.2.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-05-13

## README

# `@inquirer/expand`

Compact single select prompt. Every option is assigned a shortcut key, and selecting `h` will expand all the choices and their descriptions.

![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg)
![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg)

# Installation

```sh
npm install @inquirer/expand

yarn add @inquirer/expand
```

# Usage

```js
import expand from '@inquirer/expand';

const answer = await expand({
  message: 'Conflict on file.js',
  default: 'y',
  choices: [
    {
      key: 'y',
      name: 'Overwrite',
      value: 'overwrite',
    },
    {
      key: 'a',
      name: 'Overwrite this one and all next',
      value: 'overwrite_all',
    },
    {
      key: 'd',
      name: 'Show diff',
      value: 'diff',
    },
    {
      key: 'x',
      name: 'Abort',
      value: 'abort',
    },
  ],
});
```

## Options

| Property | Type                                                   | Required | Description                                                                               |
| -------- | ------------------------------------------------------ | -------- | ----------------------------------------------------------------------------------------- |
| message  | `string`                                               | yes      | The question to ask                                                                       |
| choices  | `Array<{ key: string, name: string, value?: string }>` | yes      | Array of the different allowed choices. The `h`/help option is always provided by default |
| default  | `string`                                               | no       | Default choices to be selected. (value must be one of the choices `key`)                  |
| expanded | `boolean`                                              | no       | Expand the choices by default                                                             |

# License

Copyright (c) 2022 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
Licensed under the MIT license.

---
_Source: https://npm.io/package/@developertheexplorer/expand · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
