lr-smarshall / extend-json

A npm module for populating JSON files

Home Page:https://www.npmjs.org/package/extend-json

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

extend-json Build status

extend-json is a npm module for populating JSON files, with other JSON files or a specified function.

to extend Objects

">>fileB": {"file" : "./fileB.json"}

to extend Arrays

[{">>fileB": {"file" : "./fileB.json", "replace":true}}]
var extendJSON = require('./index');
var fileA = require('./fileA.json');

extendJSON(fileA).then(function (json) {
   console.log(JSON.stringify(json, null, 4))
}).catch(function (e) {
    console.log('error', e);
});

Options are optional and default to

extendJSON(fileA, {pointer:'>>', path:'./'})

About

A npm module for populating JSON files

https://www.npmjs.org/package/extend-json


Languages

Language:JavaScript 100.0%