<commit_before>* confo - simple config file reader
Managing configs for different environments in =js= or =json= format.

** How to use
- Install it with =npm install confo=
- Create a =confo.json= file in the same folder as the main entry point (usually project root). This file must contain a =env: path= JSON object like this:

  #+BEGIN_SRC javascript
  {
    "dev": "./config/environments/dev.js",
    "production": "./config/environments/production.js",
    "test": "./config/environments/.js"
  }
  #+END_SRC
- Create a config file. I prefer to write config files with =JavaScript=. It gives me the opportunity to use the language features like path joining or extend a base config. But you can use =JSON= too.

  #+CAPTION: Example configuration file dev.js
  #+BEGIN_SRC javascript
  var config = require('./base.js');

  config.db.port = 28017;
  config.db.host = '127.0.0.1';

  module.exports = config;
  #+END_SRC

- Just require =confo= and use it:

  #+BEGIN_SRC javascript
  var confo = require('confo');

  console.log(confo.db.host);
  #+END_SRC

- That's it!
** License
MIT<commit_msg>Fix readme<commit_after>* confo - simple config file reader
Managing configs for different environments (based on =NODE_ENV= variable) in =js= or =json= format.

** How to use
- Install it with =npm install confo=
- Create a =confo.json= file in the same folder as the main entry point (usually project root). This file must contain an =NODE_ENV: PATH= JSON object like this:

  #+CAPTION: confo.json
  #+BEGIN_SRC javascript
  {
    "dev": "./config/environments/dev.js",
    "production": "./config/environments/production.js",
    "test": "./config/environments/test.js"
  }
  #+END_SRC
- Create a config file. I prefer to write config files with =JavaScript=. It gives me the opportunity to use the language features like path joining or extending a base config. But you can use =JSON= as well.

  #+CAPTION: config/environments/dev.js
  #+BEGIN_SRC javascript
  var config = require('./base.js');

  config.db.port = 28017;
  config.db.host = '127.0.0.1';

  module.exports = config;
  #+END_SRC

- Just require =confo= and use it:

  #+CAPTION: app.js
  #+BEGIN_SRC javascript
  var confo = require('confo');

  console.log(confo.db.host);
  #+END_SRC

- That's all!
** License
MIT
{'fraction_non_alphanumeric': 0.1204714098646879, 'fraction_numerical': 0.00960279353993889, 'mean_word_length': 3.639676113360324, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6285560', 'n_tokens_mistral': 772, 'n_tokens_neox': 722, 'n_words': 268}