lacspace-json
The friendly jq — query, patch, convert, canonicalize.
npx lacspace-jsonEverything, in one command
lacspace-json gives you the 80% of jq you actually use — paths, select, map, sort_by, group_by, aggregates — plus first-class format conversion, JSON Schema validation, structural diff and deep merge, all behind one small binary with no dependencies. The query engine is a hand-written tokenizer→evaluator (no eval) and every object built from input is guarded against prototype pollution. Everything runs locally: no key, no account, no network, no telemetry.
What's inside
Safe jq-style query
paths, pipes, select, map, sort_by, group_by, aggregates; no eval.
5-format convert
JSON ⇄ YAML ⇄ TOML ⇄ CSV ⇄ NDJSON with auto-detection.
JSON Schema validation
draft-07 subset with clear per-error paths, non-zero exit.
Structural diff
added/removed/changed with dotted/bracket paths, coloured or --json.
Deep merge
N documents, array strategy concat/replace/by-key.
Pipe-friendly
reads stdin, --raw unquoted scalars, --get shorthand, --min/--sort-keys.
Zero deps, fully typed
dual ESM+CJS library sharing the CLI engine.
JSONPath queries
$.store.book[*].price, recursive $..author, wildcards, slices and [?(@.price<10)] filters.
JSON Patch (RFC 6902)
Apply a patch or generate one from two documents; add/remove/replace/move/copy/test.
JSON Pointer (RFC 6901)
Resolve /a/b/0 addresses from CLI or library, with escape-aware parsing.
flatten / unflatten
Collapse to a { "a.b[0]": v } map and rebuild it, round-trip lossless.
Canonical JSON
Deep key-sort + minimal whitespace for stable hashing and reproducible diffs.
Copy, paste, done
Real commands and snippets — from a one-liner to the typed library.
cat users.json | lacspace-json -q '.users[] | select(.active) | .email' -rjq-style query, unquoted for the shell.
lacspace-json convert config.toml --to yamlAuto-detects input from the extension.
cat people.csv | lacspace-json convert --from csv --to jsonHeader row becomes object keys.
lacspace-json validate user.json --schema user.schema.jsonExits 1 with per-error paths if invalid.
lacspace-json diff old.yaml new.yamlWorks across formats too.
lacspace-json merge base.json patch.json --array by-key --array-key idMatches array items by id.
echo '{"store":{"book":[{"price":8.95},{"price":22.5}]}}' | npx lacspace-json -q '$..price'$-style JSONPath with recursive descent.
npx lacspace-json diff old.json new.json --patchRFC 6902 patch that turns old into new.
npx lacspace-json patch doc.json changes.jsonadd/remove/replace/move/copy/test ops.
npx lacspace-json sort data.json --canonical | shasumSorted keys, minimal whitespace for stable hashing.
What people build with it
✓ Explore & reshape API responses in the terminal
✓ Convert config between YAML/TOML/JSON in build scripts
✓ CI gate that validates data against a schema
✓ Review what changed between two config/data files
Run lacspace-json today
Free, open-source, no API keys. It's a CLI and a typed library.
npx lacspace-json