# json-extend-reader

> Can be a keyword extend to inherit other json

Latest version **1.0.2** (published 2022-05-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install json-extend-reader
pnpm add json-extend-reader
yarn add json-extend-reader
bun add json-extend-reader
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-05-08 |
| First published | 2022-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Corry Wen |
| Maintainers | corry-wen |
| Keywords | json, extend, json extend |

## Links

- npm: https://www.npmjs.com/package/json-extend-reader
- Repository: https://github.com/BENcorry/json-extend-reader
- Homepage: https://github.com/BENcorry/json-extend-reader#readme
- Issues: https://github.com/BENcorry/json-extend-reader/issues
- npm.io page: https://npm.io/package/json-extend-reader

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.2 (latest) — 2022-05-08
- 1.0.1-beta4 — 2022-05-08
- 1.0.1-beta3 — 2022-05-08
- 1.0.1-beta2 — 2022-05-07
- 1.0.1-beta — 2022-05-07
- 1.0.1 — 2022-05-07
- 1.0.0 — 2022-05-07

## README

# USAGE

## Install

```sh
npm i json-extend-reader
```

## Code

```js
import { jsonExtendReader } from "json-extend-reader";
// common
const { jsonExtendReader } = requie('json-extend-reader')

const res = jsonExtendReader(path.join(__dirname, "a.json"));
```

```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**

```json
{
  "extend": ["./b.json"],
  "id": "33",
  "value": "corry"
}
```

---
_Source: https://npm.io/package/json-extend-reader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
