lacspace-json

The friendly jq — query, convert, validate & merge.

terminal
npx lacspace-json
What it does

Everything, 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.

Features

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.

How to use

Copy, paste, done

Real commands and snippets — from a one-liner to the typed library.

Filter + project
terminal
cat users.json | lacspace-json -q '.users[] | select(.active) | .email' -r

jq-style query, unquoted for the shell.

TOML → YAML
terminal
lacspace-json convert config.toml --to yaml

Auto-detects input from the extension.

CSV → JSON
terminal
cat people.csv | lacspace-json convert --from csv --to json

Header row becomes object keys.

Validate
terminal
lacspace-json validate user.json --schema user.schema.json

Exits 1 with per-error paths if invalid.

Diff
terminal
lacspace-json diff old.yaml new.yaml

Works across formats too.

Merge by key
terminal
lacspace-json merge base.json patch.json --array by-key --array-key id

Matches array items by id.

Good for

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

Start now

Run lacspace-json today

Free, open-source, no API keys. It's a CLI and a typed library.

terminal
npx lacspace-json