News for hackers. Stuff that matters.
Re:Jolt – JSON to JSON transformation by donpdonp on Wednesday November 23, 2016 @12:16PM (#13024019)
I was hoping jolt was a command line tool in the style of jq. I dont believe jq does transformations of json, only queries.
Re:Jolt – JSON to JSON transformation by mdaniel on Wednesday November 23, 2016 @12:52PM (#13024305)
> I was hoping jolt was a command line tool in the style of jq. I dont believe jq does transformations of json, only queries.

I guess that depends on one's definition of transformation but:

    echo '{"hello": "world"}' | jq '{brave:{"new": .hello}}'
it also doesn't even require JSON input, meaning one could use it strictly for composing valid output JSON:

    # where -n = null input
    jq -n --arg foo bar '{"meet me": ("at the "+$foo)}'
I use it for transforming AWS responses all the time. I put jq up there with vim as one of the "must have" tools. In fact, the keys `%!jq .` are burned into my fingers because I type them a lot

_ed: fixed a mobile character replacement, added in the --arg flag I couldn't remember at the time_

Re:Jolt – JSON to JSON transformation by fiatjaf on Wednesday November 23, 2016 @03:43PM (#13025696)
It does! And you can do wonders with it. It has functions that make it capable of doing almost anything.

Also, my project https://requesthub.xyz/ relies entirely on the transformation capabilities of jq. See real world examples of jq transformations in this context: https://gist.github.com/fiatjaf/1d57953aa285b9bf5b51712268cf...

Re:Jolt – JSON to JSON transformation by dozzie on Wednesday November 23, 2016 @02:17PM (#13024997)
You should rather look at App::RecordStream. Last time I compared them jq was a poor cousin of App::RecordStream.