A rust implementation of the popular command-line JSON processor, jq
.
cargo install --git https://github.com/M-J-Hooper/rq
curl 'https://api.github.com/repos/M-J-Hooper/rq/commits' | rq '.[].sha'
- Parse JSON input using
serde_json
. - Parse
jq
query syntax into aQuery
using a recursive parser built withnom
. - Execute query against the JSON value which recursively propagates through the nested queries to produce JSON values as a result.
This was mostly done as a learning exercise and as such it does not support some of the more obscure (and less useful) features of the original. However, it is likely feature-complete enough for day-to-day use.