<commit_before># rob-config
[![NPM version](http://img.shields.io/npm/v/rob-config.svg)](https://www.npmjs.org/package/rob-config)
[![Build Status](https://travis-ci.org/jeromemacias/node-rob-config.svg?branch=master)](https://travis-ci.org/jeromemacias/node-rob-config)

Robust configuration module for nodejs, built on top of [`convict`](https://github.com/mozilla/node-convict).

## Installation

`npm install rob-config`

## Why another config package?

[`config`](https://github.com/lorenwest/node-config) is a very simple and powerfull config package but it lacks from schema and validation.

[`convict`](https://github.com/mozilla/node-convict) is not simple to use, but way more robust and overridable.

So I wanted something:

- Easy to use like `config`
- With schema and documentation like `convict`
- With possibility to override with env variable or command line argument like `convict`
- With a command to validate config for dev AND before deployment to production
- With a command to see the builded config depends on env and default value (easier to debug)

Here it is and it's very easy to migrate from `config` or `convict`.

## Usage

Define a config schema, simple object (see https://github.com/mozilla/node-convict#the-schema for documentation about schema definition):

For example: `config/schema.js`
```js
module.exports = {
    env: {<commit_msg>[skip ci] Fix install instruction<commit_after># rob-config
[![NPM version](http://img.shields.io/npm/v/rob-config.svg)](https://www.npmjs.org/package/rob-config)
[![Build Status](https://travis-ci.org/jeromemacias/node-rob-config.svg?branch=master)](https://travis-ci.org/jeromemacias/node-rob-config)

Robust configuration module for nodejs, built on top of [`convict`](https://github.com/mozilla/node-convict).

## Installation

`npm install rob-config --save`

## Why another config package?

[`config`](https://github.com/lorenwest/node-config) is a very simple and powerfull config package but it lacks from schema and validation.

[`convict`](https://github.com/mozilla/node-convict) is not simple to use, but way more robust and overridable.

So I wanted something:

- Easy to use like `config`
- With schema and documentation like `convict`
- With possibility to override with env variable or command line argument like `convict`
- With a command to validate config for dev AND before deployment to production
- With a command to see the builded config depends on env and default value (easier to debug)

Here it is and it's very easy to migrate from `config` or `convict`.

## Usage

Define a config schema, simple object (see https://github.com/mozilla/node-convict#the-schema for documentation about schema definition):

For example: `config/schema.js`
```js
module.exports = {
    env: {
{'fraction_non_alphanumeric': 0.11828344752975117, 'fraction_numerical': 0.0, 'mean_word_length': 4.661224489795918, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 14, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '583309', 'n_tokens_mistral': 847, 'n_tokens_neox': 815, 'n_words': 291}