4 ms·
How is gojq different? Cursory look at the README and it seems like it implements the same language. My problem is the infrequency with which I need to use jq
by pfarrell 4y ago
How is gojq different? Cursory look at the README and it seems like it implements the same language.
My problem is the infrequency with which I need to use jq means I don't create a good learning feedback loop. The last time I used it though, I was able to walk down a decently complicated structure (indexed val in an array in a key in a hash in an array) and extract the data I wanted only having to google once. Like awk, though, I know there's a world of functionality I'm just not using.
- sitkack 4y agoYou should checkout gron, it is great at flattening fragments of json. https://github.com/tomnomnom/gron https://github.com/tomnomnom/gron
- lathiat 4y agoI have started using gron to understand the json structure to then write jq. Other times it does the job alone. It’s great.
- sitkack 4y agoYou can pipe the output of gron into fzf, it makes it kinda nice for perusing the flattened json.
- pfarrell 4y agoTIL. Thank you! I took a look and will definitely incorporate this in my work. Definitely a good idea.
- zikduruqe 4y agoAnytime jq is mentioned, gron should be mentioned shortly thereafter. It is a wonderful tool.
- lapser 4y agoIt is indeed a reimplementation of jq in go, and the reason I use it over jq is many, one of which is that it produces more helpful error messages. In fact, I've moved jq to ojq (sometimes I want to check compatibility), and ln -fs gojq jq.