Because I keep having to look at the jq
manual, here are some of my common examples for easy reference.
Some of these commands make use of my jq
modules, assuming the repo is clonsed to a heaths
directory in the default or specified module root e.g., ~/.jq/heaths
.
Select all instances of a dependency from cargo metadata
in a workspace and put them into a JSON array:
# Alternatively could put the whole first jq expression into square brackets but I find this easier to modify the expression.