fileconfig
Exprimenting with json configuration file loading
Installation
npm install fileconfig --save
Usage
assuming you have a configuration folder as follow :
+ /path/to/config/folder
+ apps
+ demo
this.json
+ users
hasnaer.json
{
"name" : "Demo Application"
}
- apps/demo/users/hasnaer.json
{
"fullname" : "Hasnae Rehioui"
}
Then you can fetch data as follow :
var fileconfig = require('fileconfig');
var root = fileconfig.create("/path/to/config/folder");
console.log(root);
console.log(root.apps.demo.name);
console.log(root.apps.demo.users.hasnaer.name);
TODO
Akh a whole bunch, in the process of rereading my hacks and documenting them