# inquirer-question

> flexible promise-based enhancement for one question case

Latest version **1.2.1** (published 2016-03-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install inquirer-question
pnpm add inquirer-question
yarn add inquirer-question
bun add inquirer-question
```

## 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.2.1 |
| Published | 2016-03-15 |
| First published | 2015-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ewnd9 |
| Maintainers | ewnd9 |
| Keywords | inquirer, bluebird, promise |

## Links

- npm: https://www.npmjs.com/package/inquirer-question
- Repository: https://github.com/ewnd9/inquirer-question
- Homepage: https://github.com/ewnd9/inquirer-question#readme
- Issues: https://github.com/ewnd9/inquirer-question/issues
- npm.io page: https://npm.io/package/inquirer-question

## Dependencies (2)

- [clone](https://npm.io/package/clone.md) ^1.0.2
- [inquirer-bluebird](https://npm.io/package/inquirer-bluebird.md) ^1.0.2

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.2.1 (latest) — 2016-03-15
- 1.2.0 — 2016-03-10
- 1.1.3 — 2016-01-27
- 1.1.2 — 2016-01-27
- 1.1.1 — 2015-09-04
- 1.1.0 — 2015-09-04
- 1.0.0 — 2015-08-15

## README

# inquirer-question

[![Build Status](https://travis-ci.org/ewnd9/inquirer-question.svg?branch=master)](https://travis-ci.org/ewnd9/inquirer-question)

flexible promise-based enhancement for one question case with backward capability

## Install

```
$ npm install inquirer-question --save
```

## Usage

### Before

```js
const inquirer = require('inquirer-bluebird');

inquirer
  .prompt({
    type: 'list',
    name: 'q1',
    message: 'hi',
    choices: [
      'test-1',
      'test-2'
    ]
  })
  .then(function(result) {
    if (result.q1 === 'test-1') {
      return 1;
    } else if (result.q1 === 'test-2') {
      return 2;
    }
  });
```

### Now

```js
const inquirer = require('inquirer-question');

inquirer
  .prompt({
    type: 'list',
    message: 'hi',
    choices: {
      'test-1': function() {
        // some computatations
        return 1;
      },
      'test-2': 2
    }
  })
  .then(function(result) {
    console.log(result); //=> 1 or 2
  });
```

## Related

- [inquirer](https://github.com/sboudrias/Inquirer.js)
- [inquirer-test](https://github.com/ewnd9/inquirer-test)
- [inquirer-bluebird](https://github.com/ewnd9/inquirer-bluebird)
- [inquirer-credentials](https://github.com/ewnd9/inquirer-credentials)
- [inquirer-menu](https://github.com/ewnd9/inquirer-menu)

## License

MIT © [ewnd9](http://ewnd9.com)

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