# inquirer-select-line

> Prompt for inserting into array for inquirer

Latest version **1.1.3** (published 2019-10-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install inquirer-select-line
pnpm add inquirer-select-line
yarn add inquirer-select-line
bun add inquirer-select-line
```

## 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-10-01 |
| First published | 2017-05-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 8.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Adam Golab |
| Maintainers | brainhub-adam |
| Keywords | inquirer |

## Links

- npm: https://www.npmjs.com/package/inquirer-select-line
- Repository: https://github.com/adam-golab/inquirer-select-line
- Homepage: https://github.com/adam-golab/inquirer-select-line#readme
- Issues: https://github.com/adam-golab/inquirer-select-line/issues
- npm.io page: https://npm.io/package/inquirer-select-line

## Dependencies (4)

- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [figures](https://npm.io/package/figures.md) ^2.0.0
- [inquirer](https://npm.io/package/inquirer.md) ^3.0.6
- [cli-cursor](https://npm.io/package/cli-cursor.md) ^2.1.0

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 1.1.3 (latest) — 2019-10-01
- 1.1.2 — 2019-10-01
- 1.1.1 — 2017-05-15
- 1.1.0 — 2017-05-13
- 1.0.1 — 2017-05-13
- 1.0.0 — 2017-05-13

## README

# inquirer-select-line

select-line prompt for [inquirer](https://github.com/SBoudrias/Inquirer.js)

![demo](https://media.giphy.com/media/xUA7b1MxpngddUvdHW/giphy.gif)

## Installation

```
npm install --save inquirer-select-line
```

## Usage

### Register the prompt

```javascript
inquirer.registerPrompt('selectLine', require('inquirer-select-line'));

inquirer.prompt({
  type: 'selectLine',
  message: message,
  name: name,
  choices: choices,
  placeholder: placeholder,
})
```

Change `selectLine` to whatever you might prefer.

### Options
-**message** : (*String*|*Function*) The question to print. If defined as a function, the first parameter will be the current inquirer session answers.

-**name** : (*String*) The name to use when storing the answer in the answers hash. If the name contains periods, it will define a path in the answers hash.

-**choices**: (*Array*|*Function*) Choices array or a function returning a choices array. If defined as a function, the first parameter will be the current inquirer session answers. Array values have to be simple strings. The choices array can also contain [a Separator](https://github.com/SBoudrias/Inquirer.js/#separator).

-**placeholder** (*String*|*Function*) The name to display as a placeholder for chosen line. If defined as a function, the first parameter will be index of currently chosen answer. (optional) default: `INSERT HERE`.

#### Example

```javascript
inquirer.registerPrompt('selectLine', require('inquirer-selectLine'));
inquirer.prompt([{
  type: 'selectLine',
  message: 'Where add line?',
  name: 'line',
  choices: ['first', 'second', 'third', 'fourth'],
}]).then(function(answers) {
    console.log('Chosen line: ' answers.line);
    /*
    OUTPUT :
    Chosen line: 2
    */
});
```

## License
MIT

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