0.0.1 • Published 10 years ago

loadjsons v0.0.1

Weekly downloads
13
License
-
Repository
github
Last release
10 years ago

LoadJsons

Load JSON from multiple files

Installation

Via npm on Node:

npm install loadjsons

Usage

Reference in your program:

var lj = require('loadjsons');

// Load project.json from current directory
var json = lj.load('project');

The elements of the JSON file to load can be strings with reference to other JSON files, relative to the parent file being loaded. The reference starts with $.

Example. Parent file:

{
    "project": "$simple",
    "author": "adam"
}

simple.json in the same directory:

{
    "title": "Simple JSON"
}

Result:

{
    "project": {
        "title": "Simple JSON"
    },
    "author": "adam"
}

To escape the initial $ use \:

{
    "project": "\\$simple",
    "author": "adam"
}

To Do

TBD

Development

git clone git://github.com/ajlopez/LoadJsons.git
cd LoadJsons
npm install
npm test

Samples

TBD

Versions

0.0.1 Published

License

MIT

Contribution

Feel free to file issues and submit pull requests � contributions are welcome<

If you submit a pull request, please be sure to add or update corresponding test cases, and ensure that npm test continues to pass.