# @n1ru4l/json-patch-plus

> This is a slimmed version of [jsondiffpatch](https://github.com/benjamine/jsondiffpatch). All the code is taken from the [jsondiffpatch](https://github.com/benjamine/jsondiffpatch) repository, slimmed down, slightly altered and converted to TypeScript.

Latest version **0.3.0** (published 2026-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @n1ru4l/json-patch-plus
pnpm add @n1ru4l/json-patch-plus
yarn add @n1ru4l/json-patch-plus
bun add @n1ru4l/json-patch-plus
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2026-07-20 |
| First published | 2021-09-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 51.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 443 |
| Author | n1ru4l |
| Maintainers | n1ru4l |
| Keywords | json, patch, diff |

## Links

- npm: https://www.npmjs.com/package/@n1ru4l/json-patch-plus
- Repository: https://github.com/n1ru4l/graphql-live-query
- Homepage: https://github.com/n1ru4l/graphql-live-queries#readme
- Issues: https://github.com/n1ru4l/graphql-live-query/issues
- npm.io page: https://npm.io/package/@n1ru4l/json-patch-plus

## 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

- 0.3.0 (latest) — 2026-07-20
- 0.3.0-rc-20260720130219-41f090c3809f65d64117b705343943e437843cda (rc) — 2026-07-20
- 0.3.0-alpha-20260720125639-14552d533a10d99fe5ade90b08c0facfad626bfe (alpha) — 2026-07-20
- 0.3.0-alpha-20260720124524-d45653cebd08165a479f0429361ce3c16fd78c9b — 2026-07-20
- 0.3.0-alpha-20260720124511-240b6a46c363f4bbafde68ae0e9e891c3f6bbb5d — 2026-07-20
- 0.3.0-alpha-20260720124457-928327edc3c222db4eb01fccf303ab9eb4371973 — 2026-07-20
- 0.3.0-alpha-20260720124441-82de291d864718098034d09cd01b08d6af3e6775 — 2026-07-20
- 0.3.0-alpha-20260720124404-7f174629b0bcf2de3b7fbb5f6b17396bc569dbea — 2026-07-20
- 0.3.0-alpha-20260720124401-2a62f4d87d544f341cfbd91655d9d84a69f3696b — 2026-07-20
- 0.3.0-alpha-20260720124348-3b89a8392c5cfa595c4e9324aa1c3f95941e0bad — 2026-07-20
- 0.3.0-alpha-20260720124331-94085ecd5b7282816c848800dfaaccdf8e252c03 — 2026-07-20
- 0.3.0-alpha-20260720123954-9ecba3d81dc0d1e580ed18406d930eb5c1820b45 — 2026-07-20
- 0.2.0 — 2022-07-29
- 0.2.0-alpha-3ae5051.0 — 2022-06-27
- 0.2.0-alpha-1d12caa.0 — 2022-06-27
- … 6 more at https://npm.io/package/@n1ru4l/json-patch-plus/versions

## README

# `@n1ru4l/json-patch-plus`

This is a slimmed version of [jsondiffpatch](https://github.com/benjamine/jsondiffpatch). All the code is taken from the [jsondiffpatch](https://github.com/benjamine/jsondiffpatch) repository, slimmed down, slightly altered and converted to TypeScript.

Huge thanks to [@benjamine](https://github.com/benjamine), who did all the heavy work!

`jsondiffpatch` is a replacement for [`json-patch`](https://datatracker.ietf.org/doc/html/rfc6902) that produces more efficient patches!

`@n1ru4l/json-patch-plus` has the following changes:

- Full ESM support
- Remove Node.js runtime dependencies introduced through loggers
- Remove class wrapper structures (make code less abstract and smaller)
- Remove text diffing
- Only generate and apply patch deltas (no reversing and visualization)
- Exclude unnecessary data from patch deltas (previous value is replaced with `null`)

For a full description of the delta format please refer to the [`jsondiffpatch` docs](https://github.com/benjamine/jsondiffpatch/tree/master/docs)

## Install Instructions

```bash
yarn install -E @n1ru4l/json-patch-plus
```

## Usage

```tsx
import { diff, patch } from "@n1ru4l/json-patch-plus";

const delta = diff({
  left: {},
  right: { a: { b: 1 } },
});

const result = patch({
  left: {},
  delta,
});

console.log(result);
// logs '{ a: { b: 1 } }'
```

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