json-extends
v1.1.0
Published
A npm library for reading json files with tsconfig-like 'extends' inheritance
Downloads
1,505
Readme
json-extends
An npm library for reading json files with tsconfig-like "extends" inheritence.
Install
yarn add json-extends
Use
// config-base.json
{
"a": true,
"b": {
"someProperty": 5
}
}
// config-yellow.json
{
"extends": "config-base.json",
"a": false,
"b": {
"other": "orange"
}
}
// usage
import { GetJsonObject } from "json-extends";
let result = GetJsonObject("config-yellow.json");
console.log(result);
output:
{
"a": false,
"b": {
"someProperty": 5,
"other": "orange"
}
}