Map JSON to JSON with a Ruby snippet.
gem install dorian-json-mapAlso included in the aggregate gem:
gem install dorianjson-map [file ...] "ruby code"Run json-map -h for generated option details and json-map -v for the installed version.
- Arrays map each element. Hashes map each key/value pair. The final JSON is pretty-printed.
echo '[1,2,3]' | json-map "it = it + 1"