# configuror

> A nodejs environment config loader supporting global/local style configuration and env style (dev/test/staging/prod)

Latest version **0.1.2** (published 2016-01-21) · GPL-2.0 license · 0 weekly downloads

## Install

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

## 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.2 |
| Published | 2016-01-21 |
| First published | 2016-01-21 |
| Weekly downloads | 0 |
| License | GPL-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jonathan Willis |
| Maintainers | jonjitsu |
| Keywords | config, env, environment |

## Links

- npm: https://www.npmjs.com/package/configuror
- Repository: https://github.com/jonjitsu/node-configuror
- Homepage: https://github.com/jonjitsu/node-configuror#readme
- Issues: https://github.com/jonjitsu/node-configuror/issues
- npm.io page: https://npm.io/package/configuror

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^4.0.0
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.5.2

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 0.1.2 (latest) — 2016-01-21
- 0.1.1 — 2016-01-21
- 0.1.0 — 2016-01-21

## README

<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgheadline9">1. Configuror</a>
<ul>
<li><a href="#orgheadline3">1.1. Quick start</a>
<ul>
<li><a href="#orgheadline1">1.1.1. Global/Local style configuration</a></li>
<li><a href="#orgheadline2">1.1.2. Environment style configuration</a></li>
</ul>
</li>
<li><a href="#orgheadline8">1.2. Details</a>
<ul>
<li><a href="#orgheadline7">1.2.1. File formats</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>

# Configuror<a id="orgheadline9"></a>

Config file loader based on 2 different configuration styles:

-   Global/Local
-   Environment (dev/test/staging/prod/etc&#x2026;)

Supporting multiple file formats:

-   .js
-   .json
-   .yml

Sane defaults included&#x2026;

## Quick start<a id="orgheadline3"></a>

Given the following directory structure in your project root:

    config/
      db.js
      api.js

    var config = require('configuror')();

config will contain values from files in config/ merged.

### Global/Local style configuration<a id="orgheadline1"></a>

by adding files with .local. preceding the extension allows overriding config
options with machine specific values.

    config/
      db.js
      api.js
      db.local.js

### Environment style configuration<a id="orgheadline2"></a>

by adding files with .env. preceding the extension allows overriding config
options with environment specific values.

    config/
      db.js
      api.js
      api.test.js

    NODE_ENV=test node app.js

With NODE<sub>ENV</sub> set to test the api.test.js will override values in api.js

## Details<a id="orgheadline8"></a>

Both global/local and environment style configurations can be mixed.

There are no predefined environments such as dev/test/staging/production so you
can use any name desired for the environments.

Any of the above mentioned file formats can be used. 
db.local.yml will override db.js.

### File formats<a id="orgheadline7"></a>

1.  JS

        module.exports = {
          host: "example.com"
        }

2.  JSON

        {
          "user": "jim"
        }

3.  YAML

        ipaddress: 127.0.0.1

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