# configist

> Easy deployment configuration.

Latest version **0.2.0** (published 2013-10-02) · MIT license · 0 weekly downloads

## Install

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

## 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.2.0 |
| Published | 2013-10-02 |
| First published | 2013-10-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | walling |

## Links

- npm: https://www.npmjs.com/package/configist
- Repository: http://github.com/walling/configist
- Issues: https://github.com/walling/configist/issues
- npm.io page: https://npm.io/package/configist

## Dependencies (2)

- [dextend](https://npm.io/package/dextend.md) 0.1.x
- [minimist](https://npm.io/package/minimist.md) 0.0.x

## Recent versions

- 0.2.0 (latest) — 2013-10-02
- 0.1.1 — 2013-10-01
- 0.1.0 — 2013-10-01

## README

# Easy deployment configuration

With **configist** you get the possibility to configure your application in various ways (in precedence order):

 * `config` in `package.json`
 * `config:{environment}` in `package.json`
 * environment variables
 * command line arguments
 * custom objects

Let's say the configuration is like this:

```javascript
// package.json
{
  "config": {
    "listen": "127.0.0.1:5000"
  },
  "config:development": {
    "db": "mongodb://localhost"
  },
  "config:production": {
    "listen": "0.0.0.0:80",
    "db": "mongodb://db1.example.net:2500"
  }
}
```

Basic usage:

```javascript
var config = require('configist')().use(require('./package.json'));

console.log(config);
```

Output when NODE_ENV=development (or not given):

```
{ listen: '127.0.0.1:5000',
  db: 'mongodb://localhost',
  env: 'development' }
```

Output when NODE_ENV=production:

```
{ listen: '0.0.0.0:80',
  db: 'mongodb://db1.example.net:2500',
  env: 'production' }
```

You can change the configuration dynamically. The commands are all equivalent and sets the `listen` parameter:

```bash
node . --listen=:3000
npm start --listen=:3000
LISTEN=:3000 node .
LISTEN=:3000 npm start
```

You can load multiple configurations:

```javascript
var configist = require('configist')();

configist.use(null, {
  base_url: 'http://example.com'
});
configist.use(require('./package.json'));
configist.use(require('./client-side/package.json'));
configist.use('development', {
  shared_secret: 'sg4lWb15Lt7OZYR/yyly3S1HrVou1xMN'
});

console.log(configist);
```

Happy hacking!

By the way, you can install it:

```bash
npm install configist
```

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