diff --git a/download/linux_x86_64/jq b/download/linux_x86_64/jq index 5a36b202..4395acc1 100755 Binary files a/download/linux_x86_64/jq and b/download/linux_x86_64/jq differ diff --git a/download/osx_64/jq b/download/osx_64/jq index 47a4f223..c7b521ec 100755 Binary files a/download/osx_64/jq and b/download/osx_64/jq differ diff --git a/index.html b/index.html index e9083a16..60acff43 100644 --- a/index.html +++ b/index.html @@ -55,7 +55,7 @@
jq is a lightweight and flexible command-line JSON processor.
jq is a lightweight and flexible command-line JSON processor.
A jq program is a “filter”: it takes an input, and produces an output. There are a lot of builtin filters for extracting a particular field of an object, or converting a number to a string, or various other standard tasks.
Filters can be combined in various ways - you can pipe the output of one filter into another filter, or collect the output of a filter into an array.
Some filters produce multiple results, for instance there’s one that produces all the elements of its input array. Piping that filter into a second runs the second filter for each element of the array. Generally, things that would be done with loops and iteration in other languages are just done by gluing filters together in jq.
It’s important to remember that every filter has an input and an output. Even literals like “hello” or 42 are filters - they take an input but always produce the same literal as output. Operations that combine two filters, like addition, generally feed the same input to both and combine the results. So, you can implement an averaging filter as add / length - feeding the input array both to the add filter and the length filter and dividing the results.
But that’s getting ahead of ourselves. :) Let’s start with something simpler:
-jq filters run on a stream of JSON data. The input to jq is parsed as a sequence of whitespace-separated JSON values which are passed through the provided filter one at a time. The output(s) of the filter are written to standard out, again as a sequence of whitespace-separated JSON data.
+ +You can affect how jq reads and writes its input and output using some command-line options:
+ +--slurp/-s
Instead of running the filter for each JSON object in the input, read the entire input stream into a large array and run the filter just once.
+--raw-input/-R
Don’t parse the input as JSON. Instead, each line of text is passed to the filter as a string. If combined with --slurp, then the entire input is passed to the filter as a single long string.
--null-input/-n
Don’t read any input at all! Instead, the filter is run once using null as the input. This is useful when using jq as a simple calculator or to construct JSON data from scratch.
--compact-output / -c
By default, jq pretty-prints JSON output. Using this option will result in more compact output by instead putting each JSON object on a single line.
+--ascii-output / -a
jq usually outputs non-ASCII Unicode codepoints as UTF-8, even if the input specified them as escape sequences (like “\u03bc”). Using this option, you can force jq to produce pure ASCII output with every non-ASCII character replaced with the equivalent escape sequence.
+--raw-output / -r
With this option, if the filter’s result is a string then it will be written directly to standard output rather than being formatted as a JSON string with quotes. This can be useful for making jq filters talk to non-JSON-based systems.
+