jaq is a jq clone with a focus on correctness, speed, and simplicity.
jaq 0.10.0 improves JSON parsing speed, supports regular expression filters and walk(f), and improves compatibility of foreach syntax and arguments handling.
Details:
- JSON parsing: This release parses JSON using the new hifijson crate instead of serde_json.
This increases JSON parsing performance, in one benchmark by up to 87% compared to jaq 0.9.0 and by 68% compared to jq. - Regular expressions: The filters
test,scan,match,capture,splits,sub,gsubare now supported.
Note that for named capture groups, the syntax(?<name>exp)is not supported when installing jaq bycargo install jaq;
however, it is supported when installing jaq usingcargo build,cargo install --path jaqorcargo install --git https://github.com/01mf02/jaq.
This is because the underlying crate for parsing regular expressions,regex-syntax, does not support the(?<name>exp)syntax at the time of writing, so jaq currently uses a patched version of this crate, which is however not considered bycargo install jaq. In the future, the(?<name>exp)syntax is likely to be included inregex-syntax, which will make the(?<name>exp)syntax available also when installing jaq viacargo install jaq. foreach,for: In jq 0.9, the semantics offoreach xs as $x (init; f)were changed such that it yielded the output ofinit, unlike jq. Following some discussion, the suggestion by @pkoppstein was implemented that restored the previous semantics offoreach, while introducing a new filterfor xs as $x (init; f)that yields the output ofinit. More information can be found in the README.- Arguments handling: The
--slurpfileand--rawfileoptions are now supported. Furthermore, arguments (such as passed by--arg a b) are now bound to$ARGS.
New Contributors
Full Changelog: v0.9.0...v0.10.0