json-extends
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

json-extends

CI npm npm

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"
  }
}

For more detailed examples, check out the tests!

Readme

Keywords

none

Package Sidebar

Install

npm i json-extends

Weekly Downloads

352

Version

1.1.0

License

MIT

Unpacked Size

18 kB

Total Files

20

Last publish

Collaborators

  • zumwald