Re:Show HN: A cli JSON processor powered by Node.js
by brianparks on Wednesday July 30, 2014 @08:51AM
(#8107752)
From your page: "I tried jq, which seems very good. However I was not quite able to grasp its syntax, so I gave up searching and I created my own."
I use jq on an almost daily basis, so I can sympathize with your plight. jq's syntax is documented quite well (if rather succinctly), but one non-intuitive thing is that it is possible to end up with non-JSON output if you use jq's array ([]) operator rather than the map() filter. However, I still prefer its syntax as one pipeline similar to UNIX one-liners rather than several command-line args, probably purely out of similarity to how I think about the data. I think about its transformations, rather than as independent selection and projection steps. This may be personal preference, but I'm curious as to your thoughts on syntactical choices.
I use jq on an almost daily basis, so I can sympathize with your plight. jq's syntax is documented quite well (if rather succinctly), but one non-intuitive thing is that it is possible to end up with non-JSON output if you use jq's array ([]) operator rather than the map() filter. However, I still prefer its syntax as one pipeline similar to UNIX one-liners rather than several command-line args, probably purely out of similarity to how I think about the data. I think about its transformations, rather than as independent selection and projection steps. This may be personal preference, but I'm curious as to your thoughts on syntactical choices.