<commit_before># json-configurator

Configuration tool for loading json that contains environment variables.
Prefix your environment variables with *$* and postfix it with *_*  (se example)
```
var config = {
  apiEndpoint : 'https://test.com',
  $prod_apiEndpoint' : 'https://prod.com'
  $local_apiEndpoint' : 'http://localhost:8080'
};

require('json-configurator')(configJson, 'prod').apiEndpoint; // https://prod.com
require('json-configurator')(configJson, 'local').apiEndpoint; // http://localhost:8080
require('json-configurator')(configJson, 'foobar').apiEndpoint; // https://test.com
```


## Install

```
$ npm install --save json-configurator
```


## Usage

```js
var configJson = {
  foo: 'bar',<commit_msg>change readme<commit_after># json-configurator

Configuration tool for loading json that contains environment variables. 
It supports variables which is deeply nested!!
Prefix your environment variables with *$* and postfix it with *_*  (se example)
```
var config = {
  apiEndpoint : 'https://test.com',
  $prod_apiEndpoint' : 'https://prod.com'
  $local_apiEndpoint' : 'http://localhost:8080'
};

require('json-configurator')(configJson, 'prod').apiEndpoint; // https://prod.com
require('json-configurator')(configJson, 'local').apiEndpoint; // http://localhost:8080
require('json-configurator')(configJson, 'foobar').apiEndpoint; // https://test.com
```


## Install

```
$ npm install --save json-configurator
```


## Usage

```js
var configJson = {
  foo: 'bar',
{'fraction_non_alphanumeric': 0.17069892473118278, 'fraction_numerical': 0.010752688172043012, 'mean_word_length': 5.004032258064516, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, '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': '279443', 'n_tokens_mistral': 485, 'n_tokens_neox': 452, 'n_words': 107}