# nquirer

> Hierarchical configuration with nconf combined with inquirer to prompt user for missing configuration.

Latest version **0.1.8** (published 2016-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install nquirer
pnpm add nquirer
yarn add nquirer
bun add nquirer
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2016-10-17 |
| First published | 2016-10-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Corey Ferguson |
| Maintainers | coreyferguson |
| Keywords | nquirer, nconf, inquirer, configuration, config, prompt |

## Links

- npm: https://www.npmjs.com/package/nquirer
- Repository: https://github.com/coreyferguson/nquirer
- Homepage: https://github.com/coreyferguson/nquirer#readme
- Issues: https://github.com/coreyferguson/nquirer/issues
- npm.io page: https://npm.io/package/nquirer

## Dependencies (2)

- [nconf](https://npm.io/package/nconf.md) ^0.8.4
- [inquirer](https://npm.io/package/inquirer.md) ^1.2.2

## 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

- 0.1.8 (latest) — 2016-10-17
- 0.1.6 — 2016-10-14
- 0.1.5 — 2016-10-14
- 0.1.4 — 2016-10-14
- 0.1.3 — 2016-10-14

## README

# nquirer

Hierarchical configuration with [nconf](https://github.com/indexzero/nconf)
combined with [inquirer](https://github.com/SBoudrias/Inquirer.js) to prompt
user for missing configuration.

## Install

```bash
npm install --save nquirer
```

## Usage

Here's an example retrieving username and password with following rules:

- Username required as command line argument.
- Password optional as command line argument.
- Prompt for password if command line argument not provided.

```javascript
const { nconf, necessitate, inquire } = require('nquirer');

// Default nconf configuration
// https://github.com/indexzero/nconf
nconf
  .env()
  .argv({
    "username": {
      "alias": "u",
      "describe": "Username",
      "demand": true
    },
    "password": {
      "alias": "p",
      "describe": "Password"
    }
  })
  .file('path/to/default-config.json');

// Prompt for missing configurations via Inquirer questions.
// Questions passed directly to Inquirer.
// https://github.com/SBoudrias/Inquirer.js#questions
necessitate([{
  type: 'password',
  name: 'password',
  message: 'Password'
}]);

// Prompt for missing configurations and continue with application logic...
inquire().then(nconf => {
  const username = nconf.get('username');
  const password = nconf.get('password');
  console.log(`Username: ${username}`);
  console.log(`Password: ${password}`);
  // ...
});

```

## API

API documentation can be found here: https://coreyferguson.github.io/nquirer/module-nquirer.html

It can also be found directly in the source: [`src/nquirer.js`](./src/nquirer.js)

## Contribution

See [CONTRIBUTE.md](./CONTRIBUTE.md)

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