# select-shell

> list of select for nodejs on terminal.

Latest version **1.1.3** (published 2019-08-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install select-shell
pnpm add select-shell
yarn add select-shell
bun add select-shell
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2019-08-02 |
| First published | 2014-06-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 26.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 39 |
| Author | luizstacio |
| Maintainers | luizstacio |
| Keywords | select, list, checklist, options, list, options, list, checkbox |

## Links

- npm: https://www.npmjs.com/package/select-shell
- Repository: https://github.com/luizstacio/select-shell
- Issues: https://github.com/luizstacio/select-shell/issues
- npm.io page: https://npm.io/package/select-shell

## Dependencies (1)

- [colors](https://npm.io/package/colors.md) ~0.6.2

## Recent versions

- 1.1.3 (latest) — 2019-08-02
- 1.1.2 — 2018-06-30
- 1.0.1 — 2018-06-17
- 1.0.0 — 2017-07-19
- 0.1.1 — 2015-09-26
- 0.1.0 — 2015-09-23
- 0.0.5 — 2014-08-04
- 0.0.4 — 2014-07-01
- 0.0.1 — 2014-06-29

## README

select-shell
============

##### **Item selection _for commandline nodejs apps._**

- [x] Easy to use.
- [x] Single / multiple item-select.
- [x] Optional cancel message.
- [x] Color/styling/spacing options.
- [x] Only depends on 'colors'!


![select-shell example image](https://raw.github.com/mralexgray/select-shell/selection-options/sample.png)


#### Installation
```
npm install select-shell
```

#### Usage

Simply navigate + make selection with the arrow keys...

**Up and Down** - Navigates on the options<br/>
**Right** - Check the option<br/>
**Left** - Uncheck the option<br/>
**Enter/Return** - confirms the options selected<br/>
**Esc** - Cancel/Exit<br/>

#### Code
```js
'use strict';

var list = require('./index')(
  /* possible configs */
  {
    pointer: ' ▸ ',
    pointerColor: 'yellow',
    checked: ' ◉  ',
    unchecked:' ◎  ',
    checkedColor: 'blue',
    msgCancel: 'No selected options!',
    msgCancelColor: 'orange',
    multiSelect: true,
    inverse: true,
    prepend: true,
    disableInput: true
  }
);

var stream = process.stdin;

list.option(' One    ')
    .option(' Two    ')
    .option(' Three  ')
    .list();

list.on('select', function(options){
  console.log(options);
  process.exit(0);
});

list.on('cancel', function(options){
  console.log('Cancel list, '+ options.length +' options selected');
  process.exit(0);
});
```

#### Optional configs
```js
var select = require('select-shell')(
  /* These are the default values */
  {
    pointer: '> ',
    pointerColor: 'white',
    checked: ' ✓',
    unchecked: '',
    checkedColor: 'green',
    msgCancel: 'No selected options!',
    msgCancelColor: 'red',
    multiSelect: true,
    inverse: false,
    prepend: false,
    disableInput: true
  }
);
```

#### And for coffee drinkers, please see `sample.coffee`.

```coffee
list = require('.')
  pointer    : ' ► '
  checked    : ' ◉  '
  unchecked  : ' ◎  '
  prepend    : true
```

#### The scheme of color is equal to the module [colors](https://github.com/Marak/colors.js "module colors").

| style | color | theme|
|----------|------|------|
| bold        | yellow   | rainbow |
| italic      | cyan     | random  |
| underline   | white    | zebra   |
| inverse     | magenta  |         |
|             | green    |         |
|             | red      |         |
|             | grey     |         |
|             | blue     |         |

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