4 ms·
I just use gron then grep for what I'm looking for.
by howeyc 4y ago
I just use gron then grep for what I'm looking for.
- dtech 4y agoDoes it do more than just grep? That's awfully limited compared to what jq can do. I personally like jless for just searching and exploring.
- wwader 4y agogron is great, i have this in my init.jq file for fq (https://github.com/wader/fq https://github.com/wader/fq). Sadly jq lacks a path_to_expr function so a bit harder to do it with that. def gron: ( path(..) as $p | getpath($p) | scalars | "\($p | path_to_expr) = \(tojson)" | println ); Ex: $ fq gron <<< '{"a": [1,2,{"b": 3}]}' .a[0] = 1 .a[1] = 2 .a[2].b = 3 Great for copy/paste into other expressions when poking around.