json-fmt-cli
v1.0.0
Published
A zero-dependency CLI to format, minify, validate, and query JSON
Maintainers
Readme
json-fmt-cli
A zero-dependency CLI to format, minify, validate, and query JSON from the terminal.
Install
npm install -g json-fmt-cliOr use directly with npx:
npx json-fmt-cli data.jsonUsage
# Pretty-print with 4-space indent
cat data.json | json-fmt-cli --indent 4
# Minify
json-fmt-cli file.json --minify
# Validate
json-fmt-cli file.json --validate
# Query a value
json-fmt-cli file.json --query "users[0].name"
# Pipe from stdin
curl -s https://api.example.com/data | json-fmt-cli --indent 2Options
| Option | Description |
|---|---|
| --indent <n> | Pretty-print with n spaces (default: 2) |
| --minify | Minify JSON output |
| --validate | Check if JSON is valid |
| --query <path> | Extract a value by path (e.g. users[0].name) |
| -h, --help | Show help |
| -v, --version | Show version |
License
MIT © 2026 kszongic
