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.

Flatten & unflatten

Convert nested objects to and from key.xyz.foo path notation.

ResourceWhy it is useful
flattieTiny object flattener to dot-path keys.
flat-object-keysFlatten object key paths.
nestieUnflatten dot-path keys back into nested objects.
flatten-and-unflatten snippetMy own flatten/unflatten by path snippet.

Path get / set

Safely read and write into deep properties by path.

ResourceWhy it is useful
dlvSafely read from deep properties in 120 bytes.
tiny-getMinimal deep get implementation.
dsetSafely write into deep properties in 160 bytes.
object-path-immutableSet deep values without mutating the source.
chainsetChainable deep set.
node-jsonpointerJSON Pointer get/set.
doc-pathGet/set values including arrays of objects.
deeksGet all object + array-of-object key paths.
wild-wild-pathFind/get/set deep values with rich path queries.
path-crawlerTransform values via object path.

Deep clone

ResourceWhy it is useful
klonaFast, tiny deep clone.
fast-copyFast deep clone with edge-case handling.
deep6Deep clone/equal/operations toolkit.
utils.js cloneTiny clone from a larger utils set.

Deep equality

ResourceWhy it is useful
dequalDeep equality check in 304–489 bytes.
proxy-compareCompare objects via accessed-property tracking.

Merge

ResourceWhy it is useful
deepmerge-tsDeep merge with type-aware "smartness".
deepmergeThe classic deep merge.
75lb/deep-mergeAlternative deep merge.
deepmerge gistMy own deep merge gist.
defuAssign default properties recursively, with custom fns.
automergeCRDT merge of objects across peers.

Diff & patch

ResourceWhy it is useful
object diff snippetMy own diff-between-two-objects snippet.
microdiffTiny, fast object diffing.
diff-array-objsDiff arrays of objects.
flitbit/diffDeep object diffing.
superdiffCompare objects and arrays, returns granular diffs.
json-differenceGet the difference between two JSON objects.
json-diff-tsTyped JSON diff with change records.
micropatchApply patches produced by microdiff.
simple-json-patchMinimal JSON Patch implementation.
object-diff-patchDiff then patch objects.
just-diffDependency-free diff/patch from the just suite.
jsondiffpatchJSON diff/patch with a visual demo (demo).
json-diffCLI/lib JSON diffing.

Query objects/JSON with paths, expressions, or fuzzy matching.

ResourceWhy it is useful
sift.jsMongoDB-style query against objects.
mongo-like-filtersMongo-style filter expressions.
querylQuery language for JS objects.
liqeLucene-like query for arrays/objects.
mistqlMiniature query language for JSON.
Json-FunctionQuery and transform JSON via functions.
JSONataJSON query and transformation language (ui-core).
JMESPathJSON query spec (js impl).
sputterSearch an AST object with CSS-like queries.
fuzzy-json-searchFuzzy search over JSON.
fuzzy-searchGeneric fuzzy search.
fuzzysortFast fuzzy sort/search.
simple search gistMy own simple search snippet.
waldojsFind values deep in an object.
filter-whereFilter arrays by a where-clause.
graspSearch JS structurally.

Transform & map

Rename keys, reshape, and walk/transform values.

ResourceWhy it is useful
shapifyEasily transform objects / rename keys.
morphmorphMap and transform object shapes.
micro-transformTiny object transformer.
bidoofValue matching and transforming tool.
bibarelWalk and transform object values.
packrupConvert objects/arrays between formats.
normalizrNormalize nested objects by schema.

Traverse & iterate

ResourceWhy it is useful
azu/traverseRecursively traverse objects.
object-scanScan objects with glob-like key matching.
tree-visitGeneric tree traversal helpers.
for-each-property-deepCallback on each object prop, deeply.
accessor-log-proxyLog property access via proxies.

Immutability

ResourceWhy it is useful
immutability-helperMutate copies of data without changing the source.
icepickTreat frozen objects as persistent immutable collections.
freezerWatch object changes without proxies.

Schema, shape & validation

ResourceWhy it is useful
has-shapeCheck whether an object matches a shape.
json-schema-filterFilter an object by JSON schema.
shapeInfer the shape/schema of an object.
schema-inferInfer schema from sample data.
superstructComposable runtime validation.
typedRuntime type validation.
@sapphire/typeGet a precise type string for any value.

Misc object utils

ResourceWhy it is useful
mitsuketaAssorted deep object utilities.
jsonpackCompress JSON objects.
zipsonCompress JSON with streaming support.
node-signobjEncrypt/sign an object with a secret.
test-mixerGenerate all possible object permutations for testing.
ch-dataGenerate dummy data based on a schema.
json-stringify-pretty-compactPrettify / format JS objects compactly.

JSON toolkits

ResourceWhy it is useful
json-joyAlmost everything JSON in one place.
awesome-jsonCurated list of JSON tooling.
json-source-mapJSON source maps.
devalueSerialize when JSON.stringify can't.
destrFaster, safer JSON parse.
comment-jsonParse and keep comments in JSON.
node-jsonc-parserParse JSON with comments (JSONC).
fast-json-stable-stringifyDeterministic, faster stringify.
canonicalizeCanonical (RFC 8785) JSON.
jsonabcAlpha-sort JSON keys.
flattedFast, minimal circular JSON parser.
momoaTokenize JSON into an AST.
ndjson-feParse streaming NDJSON.
json-convert gistMy own JSON-to-JS-object snippet.

JSON schema

ResourceWhy it is useful
json-schema-fnsProgrammatically build JSON schema.
generate-schemaGenerate JSON schema from an object.
genson-jsInfer JSON schema from samples.
cambriaEvolve a JSON schema definition (writeup).
json-schema-ref-parserResolve nested $refs in JSON schema.

JSON serialization & transforms

ResourceWhy it is useful
zenjsonSerialize special types into JSON-compatible data.
serialize-javascriptSerialize JS including regexps, dates, functions.
json-serializerSerialize/deserialize complex values to JSON.
json-logic-jsBuild rules as JSON and execute them.

JSON subset, hash & misc

ResourceWhy it is useful
is-subset-ofVerify an array/object is a subset of another.
partofCheck structural containment.
comparejsCompare values/structures.
deep-hashDeep-hash an object's values.
node-object-hashStable hash of an object.
json-spell-checkerSpell-check JSON keys/values.

Array tools

ResourceWhy it is useful
set-fnsSet operations (union, intersection, etc.).
fast-sortFast, readable array sorting.
immutable-array-prototypeImmutable versions of array methods.
node-array-diffDiff array values.
generate-comparatorsBuild complex comparators tersely.
sort-bySort arrays by one or more keys.
findsuggestionsSuggestions via Levenshtein distance.
bereichCreate ranges of numbers.
js-rangeRange/sequence generation.
move-sortMove an item to a specific index.
asyncroArray utilities for async/await.
enforce-uniqueEnforce uniqueness of values.