# inquirer-checkbox-plus-prompt

> Checkbox with autocomplete and other additions for Inquirer

Latest version **1.4.2** (published 2023-01-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install inquirer-checkbox-plus-prompt
pnpm add inquirer-checkbox-plus-prompt
yarn add inquirer-checkbox-plus-prompt
bun add inquirer-checkbox-plus-prompt
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.4.2 |
| Published | 2023-01-23 |
| First published | 2018-03-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 348.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 41 |
| Author | Mohammad Fares |
| Maintainers | faressoft |
| Keywords | inquirer, checkbox, autocomplete, search, filter, searchable, highlight, source, api, promise, command, prompt, stdin, cli, tty, menu |

## Links

- npm: https://www.npmjs.com/package/inquirer-checkbox-plus-prompt
- Repository: https://github.com/faressoft/inquirer-checkbox-plus-prompt
- Homepage: https://github.com/faressoft/inquirer-checkbox-plus-prompt#readme
- Issues: https://github.com/faressoft/inquirer-checkbox-plus-prompt/issues
- npm.io page: https://npm.io/package/inquirer-checkbox-plus-prompt

## Dependencies (5)

- [rxjs](https://npm.io/package/rxjs.md) ^6.6.7
- [chalk](https://npm.io/package/chalk.md) 4.1.2
- [lodash](https://npm.io/package/lodash.md) ^4.17.5
- [figures](https://npm.io/package/figures.md) ^3.0.0
- [cli-cursor](https://npm.io/package/cli-cursor.md) ^3.1.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.4.2 (latest) — 2023-01-23
- 1.4.1 — 2022-11-24
- 1.4.0 — 2022-11-23
- 1.3.0 — 2022-11-23
- 1.2.0 — 2022-11-21
- 1.1.0 — 2022-11-18
- 1.0.1 — 2018-03-09
- 1.0.0 — 2018-03-08

## README

# Inquirer Checkbox Plus Prompt

A plugin for [Inquirer](https://github.com/SBoudrias/Inquirer.js), similar to the original checkbox with extra features.

[![npm](https://img.shields.io/npm/v/inquirer-checkbox-plus-prompt.svg)](https://www.npmjs.com/package/inquirer-checkbox-plus-prompt)
[![npm](https://img.shields.io/npm/l/inquirer-checkbox-plus-prompt.svg)](https://github.com/faressoft/inquirer-checkbox-plus-prompt/blob/master/LICENSE)

<p align="center">
  <img width="500" src="/demo.gif?raw=true">
  <br>
  <span>The animated GIF is made by <a href="https://github.com/faressoft/terminalizer">Terminalizer</a></span>
</p>

# Installation

```
npm install inquirer-checkbox-plus-prompt
```

# Usage

You can name it with any name other than `checkbox-plus`, just change the string `'checkbox-plus'` to anything else.

```js
inquirer.registerPrompt('checkbox-plus', require('inquirer-checkbox-plus-prompt'));

inquirer.prompt({
  type: 'checkbox-plus',
  ...
})
```

# Options

Takes `type`, `name`, `message`, `source`[, `filter`, `validate`, `default`, `pageSize`, `highlight`, `searchable`] properties.

The extra options that this plugin provides are:

* **source**: (Function) a method that called to return a promise that should be resolved with a list of choices in a similar format as the `choices` option in the original `checkbox` prompt of `Inquirer`.
* **highlight**: (Boolean) if `true`, the current selected choice gets highlighted. Default: `false`.
* **searchable**: (Boolean) if `true`, allow the user to filter the list. The `source` function gets called everytime the search query is changed. Default: `false`.

# Example

Check [example.js](/example.js?raw=true) for a more advanced example.

```js
var inquirer = require('inquirer');
var fuzzy = require('fuzzy');

inquirer.registerPrompt('checkbox-plus', require('./index'));

var colors = ['red', 'green', 'blue', 'yellow'];

inquirer.prompt([{
  type: 'checkbox-plus',
  name: 'colors',
  message: 'Enter colors',
  pageSize: 10,
  highlight: true,
  searchable: true,
  default: ['yellow', 'red'],
  source: function(answersSoFar, input) {

    input = input || '';

    return new Promise(function(resolve) {

      var fuzzyResult = fuzzy.filter(input, colors);

      var data = fuzzyResult.map(function(element) {
        return element.original;
      });

      resolve(data);
      
    });

  }
}]).then(function(answers) {

  console.log(answers.colors);

});
```

# License

This project is under the MIT license.

---
_Source: https://npm.io/package/inquirer-checkbox-plus-prompt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
