4 ms·
How have you been using jq? It is more adhoc for exploring JSON files during development/data analysis or in programs that run in production?
by Yanael 3y ago
How have you been using jq? It is more adhoc for exploring JSON files during development/data analysis or in programs that run in production?
- wwader 3y agoQuite a lot! i use it to explode both JSON and tex (parse using jq functions). I also use it for exploring ane debug binary formats (https://github.com/wader/fq https://github.com/wader/fq). Now a days i also use it for some adhoc programming and a calculator.
- brundolf 3y agoYeah, I've always liked the idea of jq but personally I find it easier to open a REPL in the language I'm most familiar with (which happens to be JS, which does make a difference) and just paste in the JSON and work with it there It may be more verbose, but I never have to google anything, which makes a bigger difference in my experience
- wwader 3y agohttps://github.com/wader/fq https://github.com/wader/fq has a REPL and can read JSON. Tip is to use "paste | from_json | repl" in a REPl to paste JSON into a sub-REPL, you can also use `<text here>` with fq which is a raw string literal
- brundolf 3y agoThe important part wasn't having a REPL, it was using a language I already know off the top of my head
- Too 3y agoYes. So much easier to reuse other common helper functions. Once you’ve finished exploration you can just copy the code into production instead of translating.
- delecti 3y agoMy most common usage is pretty-printing the output of curl, or getting a list of things from endpoint service/A and then calling service/endpoint B/<entry> to do things for each entry in the list.
- Liskni_si 3y agoI use it as a "JSON library for bash". :-) Not really in "production", but I have a lot of small-ish shell scripts all over the place, mostly in ~/bin, and some in CI (GitHub Actions) as well.