0.1.0 • Published 7 years ago

njconf v0.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

njconf

Simple node.js JSON5 config module.

npm install njconf --save

API

njconf.load('config1.json5', 'config2.json5', ...) - This loads the given JSON5 config files and deep merges them in such a way that the configuration defined earlier takes priority over the the ones defined later.

Usage

const njconf = require('njconf');

njconf.load('config-specific.json5', 'config.default.json5')

Example

So lets's say that content of config-specific.json5 is:

{
  a: 'a',
  b: 'b'
}

and config.default.json5 is:

{
  a: '',
  c: 'c'
}

then the result will be:

{
  a: 'a',
  b: 'b',
  c: 'c'
}