1.0.2 • Published 3 years ago
json-extend-reader v1.0.2
USAGE
Install
npm i json-extend-reader
Code
import { jsonExtendReader } from "json-extend-reader";
// common
const { jsonExtendReader } = requie('json-extend-reader')
const res = jsonExtendReader(path.join(__dirname, "a.json"));
// a.json
{
"extend": "./b.json",
"id": "33",
"value": "corry"
}
// b.json
{
"id": "34",
"value": "corry2",
"size": 100,
"file": {
"extend": "./a.json"
}
}
// res will return
{
"id": "33",
"value": "corry",
"size": 100,
"file": {
"extend": "./a.json"
}
}
extend key must be in top-level, otherwise, it is invalid to load anther json file
Extend Type: string | string[]
extend allow to use type of string or string array
{
"extend": ["./b.json"],
"id": "33",
"value": "corry"
}
1.0.2
3 years ago
1.0.1-beta4
3 years ago
1.0.1-beta3
3 years ago
1.0.1-beta2
3 years ago
1.0.1-beta
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago