adon-config
This module is used for managing system configurations in cascading order.
assuming you have a javascript config file with the following item
modules.export = {
test: {
something: 'eureka!'
}
}
you can retrieve them easily by
let config = require('adon-config');
config.load(__dirname);
console.log("My test value is " + config.get('test.something'));
Goal of this module
- Allows developers to manage configuration files in a common structure
- Support a mix of common config file types (Javascript, JSON, Coffeescript)
- Allows overriding of configurations data on different module levels
- Allows special configurations based on server environment (NODE_ENV)
[NOTE: coffee script is not yet supported]
Installation
$ npm install adon-config --save
Setup
- In your node module, create a "config" folder where you want all the config files to exist.
- create an "env" folder within it that will contain environment specific configurations.
- inside the config folder create a file named default (javascript, json or coffeescript)
- (optional) in the "env" folder create configration overrides that you want based on the NODE_ENV value
root
|-config
| |-env
| | |-development.js
| | |-production.js
| |-default.js
|-index.js
Dependencies
adon-config relies on the following node modules
Source codes
adon-config is publicly available on Github
License
GPL