The project is in a healthy, maintained state
evaluates ruby code on deep each of json to map to another json
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

dorian-json-deep-map

Recursively map a JSON value with a Ruby snippet.

Install

gem install dorian-json-deep-map

Also included in the aggregate gem:

gem install dorian

Usage

json-deep-map [file ...] "ruby code"

Run json-deep-map -h for generated option details and json-deep-map -v for the installed version.

Notes

  • Mutate or replace it in the snippet; the final JSON is pretty-printed.

Examples

Increment every integer

echo '[1,2,3]' | json-deep-map "it = it + 1 if it.is_a?(Integer)"