JSON Transform CLI
Transform JSON like a pro. jq-alternative for Node.js developers.
Query. Reshape. Flatten. Diff. Convert.
Quick Start
bash
npm install -g @lxgicstudios/jsonmorph
bash
# Extract field
jsonmorph '.users[].name' data.json
# Transform structure
jsonmorph '{names: .users[].name, count: .users | length}' data.json
# Flatten nested JSON
jsonmorph flatten deep.json
What It Does
Query
- •jq-like syntax
- •Deep property access
- •Array operations
- •Filtering and mapping
Transform
- •Reshape objects
- •Rename keys
- •Type conversion
- •Computed fields
Utilities
- •Flatten/unflatten
- •Diff two JSONs
- •Merge objects
- •Schema extraction
Commands
bash
# Query with path
jsonmorph '.data.items[0].name' file.json
# Filter array
jsonmorph '.users | filter(.age > 25)' file.json
# Map array
jsonmorph '.items | map({id, title})' file.json
# Flatten nested object
jsonmorph flatten nested.json
# Diff two files
jsonmorph diff old.json new.json
# Merge objects
jsonmorph merge base.json override.json
# Extract schema
jsonmorph schema data.json
Piping Support
bash
# From API response curl https://api.example.com/data | jsonmorph '.results' # Chain transforms cat data.json | jsonmorph '.items' | jsonmorph 'map(.name)'
Why jsonmorph?
- •JavaScript-native - No need to learn jq syntax
- •Familiar - Uses JS-like expressions
- •Fast - Streaming support for large files
- •No deps - Pure Node.js
Built by LXGIC Studios