God I really abhor jq and it seems it's becoming a standard. I dislike it cause I'm too dumb to correctly dredge up it's incantations, and once a year I have to go reading their arcane docs. I suppose it's another fertile ground for LLM use.
The bad news is that much like how "I'm just going to DSL this ..." inevitably morphs into a full-blown programming language[1], so too is the ubiquitous "gah, your language is too complex, I'm going to just use this other tool that implements my favorite 10% of the cases"
which is a long way of saying: or else what? There's 100% no way that I'm going to ever, ever use <<python3 -c "import json, sys; print(json.load(sys.stdin)[...ohgawd...]">> and if you are, then more power to ya and jq apparently doesn't solve a problem you have
It basically dumps the flattened js equation form of the json. You can then sed grep that whatever. Then you can gron --ungron and it will make it JSON again. It works beautifully, check out the examples in their docs.
fx.wtf is also very nice as an interactive viewer with vim movements.
Then jo for creating json.
I found it much easier to use these three + core utils as compared to learning jq, lol.
What would "non-arcane" jq docs look like? I'm kind of in the same boat, being an infrequent jq user, but I've generally found the docs pretty easy to navigate.
It's a pretty good on/off-ramp into better tools. Going from arbitrary slop to something that's a reasonable input to `nixlang` or Dhall is pure win IMHO.
I get a lot of use out of `jq` even though I prefer sounder systems than JSON.
mdaniel|7 months ago
which is a long way of saying: or else what? There's 100% no way that I'm going to ever, ever use <<python3 -c "import json, sys; print(json.load(sys.stdin)[...ohgawd...]">> and if you are, then more power to ya and jq apparently doesn't solve a problem you have
1: https://www.laws-of-software.com/laws/zawinski/
porridgeraisin|7 months ago
It basically dumps the flattened js equation form of the json. You can then sed grep that whatever. Then you can gron --ungron and it will make it JSON again. It works beautifully, check out the examples in their docs.
fx.wtf is also very nice as an interactive viewer with vim movements.
Then jo for creating json.
I found it much easier to use these three + core utils as compared to learning jq, lol.
quotemstr|7 months ago
JimDabell|7 months ago
pxc|7 months ago
benreesman|7 months ago
I get a lot of use out of `jq` even though I prefer sounder systems than JSON.
ashwinsundar|7 months ago
xmonkee|7 months ago