dorian-json-pluck
Pluck one path from JSON input.
Install
gem install dorian-json-pluckAlso included in the aggregate gem:
gem install dorianUsage
json-pluck [options] key [key ...] [file ...]Run json-pluck -h for generated option details and json-pluck -v for the installed version.
Notes
- Keys can be hash keys or array indexes. Use
--jsonfor pretty JSON output or--rubyfor Ruby inspection output.
Examples
Pluck the first item
echo '[1,2,3]' | json-pluck 0Output:
1