Node.js - jsoncfg
Easily read JSON files from a directory. Great for configuration.
I store configuration data in JSON files. It's handy to load them up and parse them with one method. Also, it includes undefined field support from field.
npm install jsoncfg
Let's assume that you have the following files structure:
./config ├── database.json ├── malformed.json ├── shopping.json ├── weird\ name2.json ├── weird-name.json └── weird_name3.json
let's assume that
database.json looks like:
var jsoncfg = ;jsoncfg
loadFiles(dir, [cache], callback)
For a full configuration package, see: fnoc which is built on this.
Copyright 2013, JP Richardson firstname.lastname@example.org