4 ms·
I have a lot of trouble understanding the benefits of this versus just working with json with a programming language. It seems like you're adding another layer
by JeremyNT 3y ago
I have a lot of trouble understanding the benefits of this versus just working with json with a programming language. It seems like you're adding another layer of abstraction versus just dealing with a normal hashmap-like data structure in your language of choice.
If you want to work with it interactively, you could use a notebook or REPL.
- edu_guitar 3y agoif you are used to the command line and knows some basic syntax, it is less verbose then opening a REPL and reading a file. The fact that you can pipe the json data into it is also a plus, making it easier to check quickly if the response of a curl call has the fields/values you were expecting. Of course, if you are more comfortable doing that from the REPL, you get less value from learning jq. If you are fond of one liners, jq offers a lot of potential.
- bdcravens 3y agoPipelining CLI commands or bash scripts. From a security perspective, it may be preferable to not ship with a runtime.
- vips7L 3y agobash and jq are both runtimes.
- bdcravens 3y agoVery difficult (or often impractical) to not have a shell at all, and jq is at least limited in scope, and has no dependencies that need to be installed. Far better than a full language with its own standard library and set of dependencies to lock down.
- jonfw 3y agoUse a compiled language like golang if you don't want to ship with a runtime. If you're willing to ship w/ bash then I don't understand the opposition to JS. Either tool puts you in a scenario where somebody who can exec into your env can do whatever they want
- WuxiFingerHold 3y agoMy thoughts as well: const response = await fetch("https://api.github.com/orgs/golang/repos"); const repos = await response.json(); const groups = Map.groupBy(repos, e => e?.license?.key); ...