Node.js - jsoncfg
Easily read JSON files from a directory. Great for configuration.
Why?
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.
Installation
npm install jsoncfg
Usage
Example
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)
TODO
loadFilesSync(dir, [cache])
TODO
Config Files
For a full configuration package, see: fnoc which is built on this.
License
(MIT License)
Copyright 2013, JP Richardson jprichardson@gmail.com