Any recommendations for CLI tools for JSON querying? (It should be easy to install on macOS – e.g., via Homebrew.)
I’m only aware of jq. It’s established, but is it still the best choice?
Any recommendations for CLI tools for JSON querying? (It should be easy to install on macOS – e.g., via Homebrew.)
I’m only aware of jq. It’s established, but is it still the best choice?
@rauschma You can use `node -p …` or `nodejsscript -p` https://github.com/jaandrle/nodejsscript/blob/main/examples/eval_print.md#jq (https://www.npmjs.com/package/nodejsscript).
Also Mastodon thread:
https://fosstodon.org/@jaandrle/109901893985021722
@rauschma Bit of a left field answer: PowerShell
PowerShell has a lot of really interesting general purpose object query tools designed for command line use and ConvertFrom-Json and ConvertTo-Json work really moving from one object system to the other and back.
Of course, PowerShell has quite a learning curve and learning it just for JSON is silly, but the fact that its tools are generally applicable to more than just JSON can be handy.
@rauschma At @sanity_io, we’ve created a language called GROQ for querying data. We have a CLI tool that allows you to run GROQ queries for any JSON or NDJSON data. I find it to be a really expressive way to query data.