A curated drawer of JavaScript object and JSON utilities, grouped by the job you are trying to do. Most are tiny, focused libraries you can reach for instead of pulling in a kitchen-sink dependency.
Convert nested objects to and from key.xyz.foo path notation.
| Resource | Why it is useful |
|---|---|
| flattie | Tiny object flattener to dot-path keys. |
| flat-object-keys | Flatten object key paths. |
| nestie | Unflatten dot-path keys back into nested objects. |
| flatten-and-unflatten snippet | My own flatten/unflatten by path snippet. |
Safely read and write into deep properties by path.
| Resource | Why it is useful |
|---|---|
| dlv | Safely read from deep properties in 120 bytes. |
| tiny-get | Minimal deep get implementation. |
| dset | Safely write into deep properties in 160 bytes. |
| object-path-immutable | Set deep values without mutating the source. |
| chainset | Chainable deep set. |
| node-jsonpointer | JSON Pointer get/set. |
| doc-path | Get/set values including arrays of objects. |
| deeks | Get all object + array-of-object key paths. |
| wild-wild-path | Find/get/set deep values with rich path queries. |
| path-crawler | Transform values via object path. |
| Resource | Why it is useful |
|---|---|
| klona | Fast, tiny deep clone. |
| fast-copy | Fast deep clone with edge-case handling. |
| deep6 | Deep clone/equal/operations toolkit. |
| utils.js clone | Tiny clone from a larger utils set. |
| Resource | Why it is useful |
|---|---|
| dequal | Deep equality check in 304–489 bytes. |
| proxy-compare | Compare objects via accessed-property tracking. |
| Resource | Why it is useful |
|---|---|
| deepmerge-ts | Deep merge with type-aware "smartness". |
| deepmerge | The classic deep merge. |
| 75lb/deep-merge | Alternative deep merge. |
| deepmerge gist | My own deep merge gist. |
| defu | Assign default properties recursively, with custom fns. |
| automerge | CRDT merge of objects across peers. |
| Resource | Why it is useful |
|---|---|
| object diff snippet | My own diff-between-two-objects snippet. |
| microdiff | Tiny, fast object diffing. |
| diff-array-objs | Diff arrays of objects. |
| flitbit/diff | Deep object diffing. |
| superdiff | Compare objects and arrays, returns granular diffs. |
| json-difference | Get the difference between two JSON objects. |
| json-diff-ts | Typed JSON diff with change records. |
| micropatch | Apply patches produced by microdiff. |
| simple-json-patch | Minimal JSON Patch implementation. |
| object-diff-patch | Diff then patch objects. |
| just-diff | Dependency-free diff/patch from the just suite. |
| jsondiffpatch | JSON diff/patch with a visual demo (demo). |
| json-diff | CLI/lib JSON diffing. |
Query objects/JSON with paths, expressions, or fuzzy matching.
| Resource | Why it is useful |
|---|---|
| sift.js | MongoDB-style query against objects. |
| mongo-like-filters | Mongo-style filter expressions. |
| queryl | Query language for JS objects. |
| liqe | Lucene-like query for arrays/objects. |
| mistql | Miniature query language for JSON. |
| Json-Function | Query and transform JSON via functions. |
| JSONata | JSON query and transformation language (ui-core). |
| JMESPath | JSON query spec (js impl). |
| sputter | Search an AST object with CSS-like queries. |
| fuzzy-json-search | Fuzzy search over JSON. |
| fuzzy-search | Generic fuzzy search. |
| fuzzysort | Fast fuzzy sort/search. |
| simple search gist | My own simple search snippet. |
| waldojs | Find values deep in an object. |
| filter-where | Filter arrays by a where-clause. |
| grasp | Search JS structurally. |
Rename keys, reshape, and walk/transform values.
| Resource | Why it is useful |
|---|---|
| shapify | Easily transform objects / rename keys. |
| morphmorph | Map and transform object shapes. |
| micro-transform | Tiny object transformer. |
| bidoof | Value matching and transforming tool. |
| bibarel | Walk and transform object values. |
| packrup | Convert objects/arrays between formats. |
| normalizr | Normalize nested objects by schema. |
| Resource | Why it is useful |
|---|---|
| azu/traverse | Recursively traverse objects. |
| object-scan | Scan objects with glob-like key matching. |
| tree-visit | Generic tree traversal helpers. |
| for-each-property-deep | Callback on each object prop, deeply. |
| accessor-log-proxy | Log property access via proxies. |
| Resource | Why it is useful |
|---|---|
| immutability-helper | Mutate copies of data without changing the source. |
| icepick | Treat frozen objects as persistent immutable collections. |
| freezer | Watch object changes without proxies. |
| Resource | Why it is useful |
|---|---|
| has-shape | Check whether an object matches a shape. |
| json-schema-filter | Filter an object by JSON schema. |
| shape | Infer the shape/schema of an object. |
| schema-infer | Infer schema from sample data. |
| superstruct | Composable runtime validation. |
| typed | Runtime type validation. |
| @sapphire/type | Get a precise type string for any value. |
| Resource | Why it is useful |
|---|---|
| mitsuketa | Assorted deep object utilities. |
| jsonpack | Compress JSON objects. |
| zipson | Compress JSON with streaming support. |
| node-signobj | Encrypt/sign an object with a secret. |
| test-mixer | Generate all possible object permutations for testing. |
| ch-data | Generate dummy data based on a schema. |
| json-stringify-pretty-compact | Prettify / format JS objects compactly. |
| Resource | Why it is useful |
|---|---|
| json-joy | Almost everything JSON in one place. |
| awesome-json | Curated list of JSON tooling. |
| json-source-map | JSON source maps. |
| devalue | Serialize when JSON.stringify can't. |
| destr | Faster, safer JSON parse. |
| comment-json | Parse and keep comments in JSON. |
| node-jsonc-parser | Parse JSON with comments (JSONC). |
| fast-json-stable-stringify | Deterministic, faster stringify. |
| canonicalize | Canonical (RFC 8785) JSON. |
| jsonabc | Alpha-sort JSON keys. |
| flatted | Fast, minimal circular JSON parser. |
| momoa | Tokenize JSON into an AST. |
| ndjson-fe | Parse streaming NDJSON. |
| json-convert gist | My own JSON-to-JS-object snippet. |
| Resource | Why it is useful |
|---|---|
| json-schema-fns | Programmatically build JSON schema. |
| generate-schema | Generate JSON schema from an object. |
| genson-js | Infer JSON schema from samples. |
| cambria | Evolve a JSON schema definition (writeup). |
| json-schema-ref-parser | Resolve nested $refs in JSON schema. |
| Resource | Why it is useful |
|---|---|
| zenjson | Serialize special types into JSON-compatible data. |
| serialize-javascript | Serialize JS including regexps, dates, functions. |
| json-serializer | Serialize/deserialize complex values to JSON. |
| json-logic-js | Build rules as JSON and execute them. |
| Resource | Why it is useful |
|---|---|
| is-subset-of | Verify an array/object is a subset of another. |
| partof | Check structural containment. |
| comparejs | Compare values/structures. |
| deep-hash | Deep-hash an object's values. |
| node-object-hash | Stable hash of an object. |
| json-spell-checker | Spell-check JSON keys/values. |
| Resource | Why it is useful |
|---|---|
| set-fns | Set operations (union, intersection, etc.). |
| fast-sort | Fast, readable array sorting. |
| immutable-array-prototype | Immutable versions of array methods. |
| node-array-diff | Diff array values. |
| generate-comparators | Build complex comparators tersely. |
| sort-by | Sort arrays by one or more keys. |
| findsuggestions | Suggestions via Levenshtein distance. |
| bereich | Create ranges of numbers. |
| js-range | Range/sequence generation. |
| move-sort | Move an item to a specific index. |
| asyncro | Array utilities for async/await. |
| enforce-unique | Enforce uniqueness of values. |