New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

jsonzen

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonzen

Privacy-first JSON toolbox in your terminal. Format, validate, diff, query, and convert JSON without leaving the shell.

Source
npmnpm
Version
1.0.0-beta.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

jsonzen

Privacy-first JSON tools in your terminal — every JSON tool from jsonzen.dev, runnable as a Unix filter.

npm i -g jsonzen
# or:
npx jsonzen format api.json --sort

Works with stdin/stdout so it composes with jq, curl, xargs, and anything else in your shell.

curl -s https://api.example.com/users \
  | jsonzen jq '$.data[*].email' \
  | jsonzen format

Commands

  • jsonzen format [file] — pretty-print JSON. --indent 2/--indent 4, --sort.
  • jsonzen minify [file] — strip whitespace. Reports bytes saved on stderr.
  • jsonzen validate <data> <schema> — validate JSON against a JSON Schema (Ajv). Exits 3 on validation failure.
  • jsonzen diff <left> <right> — semantic diff between two JSON files. Exits 3 on differences.
  • jsonzen jq <query> [file] — run a JSONPath expression.
  • jsonzen jp <query> [file] — run a JMESPath expression.
  • jsonzen jwt decode <token> — decode a JWT (header + payload, no signature verification).
  • jsonzen yaml [file] — convert between JSON and YAML. --to (default) or --from.
  • jsonzen csv [file] — convert between JSON arrays and CSV. --to (default) or --from.
  • jsonzen ts [file] — generate TypeScript type declarations (quicktype).
  • jsonzen zod [file] — generate a Zod runtime validator.
  • jsonzen pydantic [file] — generate Pydantic v2 BaseModel classes.
  • jsonzen schema [file] — infer a JSON Schema (Draft 2020-12 or 07).

[file] defaults to stdin. Pass - to be explicit.

Common flags

  • -o, --output <file> — write to file instead of stdout.
  • -q, --quiet — suppress non-error output (e.g. minify's bytes-saved report).
  • --json — machine-readable error envelope: {"error":{"kind":"...","message":"..."}} to stderr.
  • -h, --help — per-command help with examples.
  • -v, --version — print the CLI version.

Exit codes

  • 0 — success
  • 1 — usage / argument error
  • 2 — input error (missing file, can't read stdin)
  • 3 — convert / validate / diff produced a non-success result
  • 4 — runtime error (uncaught)

Examples

# Round-trip JSON through a sort + key-uniqueness pass.
echo '{"b":1,"a":[3,2,1]}' | jsonzen format --sort

# Generate a TypeScript declaration from an API response.
curl -s https://api.example.com/me | jsonzen ts -n MeResponse > me.types.ts

# Validate a config file in CI.
jsonzen validate ./app.config.json ./schemas/app.json --mode all-errors

# Diff two API responses, exit non-zero if they drifted.
jsonzen diff before.json after.json -o changes.json

Privacy

Every command runs entirely on your machine. The CLI does not phone home and does not need a network connection. No account is required and nothing leaves your shell.

Keywords

json

FAQs

Package last updated on 16 May 2026

Related posts