Skip to content

ajlopez/LoadJsons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Load JSON from multiple files, for node.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published