Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 8, 2024 via pnpm

fast-json-patch 3.1.1

Fast implementation of JSON-Patch (RFC-6902) with duplex (observe changes) capabilities
Package summary
Share
0
issues
1
license
1
MIT
Package created
29 Jul 2013
Version published
24 Mar 2022
Maintainers
4
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
fast-json-patch@3.1.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of fast-json-patch 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does fast-json-patch do?

Fast-json-patch is a lean and high-performing implementation of JSON Patch (RFC-6902) that offers duplex capabilities. It allows you to apply patches or arrays/single operations to a JavaScript object, validate a sequence of patches, observe changes and generate patches when a change is detected, and compare two objects to obtain the difference. Fast-json-patch provides a judicious way to update a JSON document by sending the changes instead of the whole document, thus making it more efficient and reliable for HTTP PATCH verb and REST style programming.

How do you use fast-json-patch?

To use fast-json-patch, first, you need to install it in your project with npm:

npm install fast-json-patch --save

In a web browser, load the bundled distribution script:

<script src="dist/fast-json-patch.min.js"></script>

In Node.js, you can use fast-json-patch as an ECMAScript module:

import * as jsonpatch from 'fast-json-patch/index.mjs';
import { applyOperation } from 'fast-json-patch/index.mjs';

Or with the older CommonJS syntax:

const { applyOperation } = require('fast-json-patch');
const applyOperation = require('fast-json-patch').applyOperation;

You can then begin to apply patches. For example:

var document = { firstName: "Albert", contactDetails: { phoneNumbers: [] } };
var patch = [
  { op: "replace", path: "/firstName", value: "Joachim" },
  { op: "add", path: "/lastName", value: "Wester" },
  { op: "add", path: "/contactDetails/phoneNumbers/0", value: { number: "555-123" }  }
];
document = jsonpatch.applyPatch(document, patch).newDocument;

Where are the fast-json-patch docs?

The fast-json-patch documentation is included in the README content of the package. To access in-depth details about the fast-json-patch API and its features, you can reference this readme file on the fast-json-patch GitHub page.