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);
console.log(root.apps.demo.users['#hasnaer'].age);
TODO
- Link between components
- Do not rely on force refresh, you should always expect the latest injected properties
Changelog
v.0.1.1
- add force refresh of configured properties