Hacker News new | ask | show | jobs
by reegnz 950 days ago
JSONpath and jmespath are objectively worse than the jq language though, as you can only query, but jq also allows for very powerful transformations.

As for learning it, it's the same with any tool, key is repetition and regular use.

1 comments

i get that it's more powerful but I almost consider it an anti-feature. I have very good tools for doing transformations (sed,awk,perl, etc etc) the problem is they all want line oriented format and JSON breaks that. So all I want is a tool to go from json => line oriented and I will do the rest with the vast library of experience I already have at transformations on the command line.
> So all I want is a tool to go from json => line oriented and I will do the rest with the vast library of experience I already have at transformations on the command line.*

The tool for that is likely https://github.com/tomnomnom/gron It's probably the best tool to go back and forth easily between json and line oriented.

`jq -c paths` will show you all the paths in a JSON text. You can totally use jq in a very gron-like manner. Try it.