
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
Reduces JSON patches/RFC 6902 to to be less verbose. Saves you precious bytes.
JSON patch is a standard RFC 6902 to describe changes (diffs) in JSON documents.
Implementations:
minpatch?You'd use this module if you were storing your JSON patches in a database.
npm i --save minpatch
var assert = require('assert')
var minpatch = require('minpatch')
// these patches would be the output from whichever JSON patch package
// you choose.
var patches = [
{"op": "add", "path": "/biscuits/1", "value": {"name": "Ginger Nut"}},
{"op": "remove", "path": "/biscuits"},
{"op": "replace", "path": "/biscuits/0/name", "value": "Chocolate Digestive"},
{"op": "copy", "from": "/biscuits/0", "path": "/best_biscuit"},
{"op": "move", "from": "/biscuits", "path": "/cookies"},
{"op": "test", "path": "/best_biscuit/name", "value": "Choco Liebniz"}
]
var packed = minpatch.pack(patches)
console.dir(packed)
/* =>
[
{"op": "+", "p": "/biscuits/1", "v": {"name": "Ginger Nut"}},
{"op": "-", "p": "/biscuits"},
{"op": "R", "p": "/biscuits/0/name", "v": "Chocolate Digestive"},
{"op": "C", "f": "/biscuits/0", "p": "/best_biscuit"},
{"op": "M", "f": "/biscuits", "p": "/cookies"},
{"op": "T", "p": "/best_biscuit/name", "v": "Choco Liebniz"}
]
*/
var unpacked = minpatch.unpack(packed)
assert.deepEqual(patches, unpacked) // is true
Pack a JSON Patch array. Will not mutate input object.
Unpack a packed JSON Patch array. Will not mutate input object.
MIT
Copyright 2015 JP Richardson
FAQs
Reduces JSON patches to be less verbose. Saves you precious bytes.
We found that minpatch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.