qjson-cli
v1.0.0
Published
Query JSON data from stdin or files using dot-notation paths
Maintainers
Readme
qjson-cli
Query JSON using dot-notation paths — like
jqbut simpler. Zero dependencies.
Install
npm install -g qjson-cliUsage
# From stdin
echo '{"user":{"name":"Alice","age":30}}' | qjson user.name
# → "Alice"
# From a file
qjson version package.json
# → "1.0.0"
# Array indexing
echo '{"items":[10,20,30]}' | qjson items.1
# → 20
# Inline JSON
qjson a.b -e '{"a":{"b":"hello"}}'
# → "hello"
# Raw string output (no quotes)
echo '{"msg":"hello"}' | qjson msg -r
# → hello
# List keys
qjson dependencies -k package.json
# Show type
echo '{"a":[1,2]}' | qjson a -t
# → array
# Identity (root)
echo '{"x":1}' | qjson .
# → { "x": 1 }Options
| Flag | Description |
|------|-------------|
| -e, --expr <json> | Inline JSON string |
| -r, --raw | Output raw strings (no quotes) |
| -k, --keys | List keys at path |
| -t, --type | Show type of value |
| -h, --help | Show help |
| -v, --version | Show version |
License
MIT © kszongic
