Stacked on the modifications PR. Now that no live code path references
the per-package fetchers, the shared HTTP/parsing helpers, the
in-process normalizer, or the example template, delete them. Pure
deletion — no behavior change.
- ~93 per-package <pkg>/releases.js fetcher modules.
- _common/{brew,fetcher,git-tag,gitea,github,github-source,
githubish,githubish-source}.js shared HTTP/parsing helpers.
- _webi/normalize.js in-process normalization layer (cache files
arrive normalized from webicached).
- _example/releases.js fetcher template for new packages.
The Go cache daemon (webicached) is now the sole producer of release
metadata; the Node process never makes an upstream request.
title, homepage, tagline
| title | homepage | tagline |
|---|---|---|
| jq | https://stedolan.github.io/jq/ | jq is a lightweight and flexible command-line JSON processor. |
To update or switch versions, run webi jq@stable (or @v1.6, @beta, etc).
Files
These are the files / directories that are created and/or modified with this install:
~/.config/envman/PATH.env
~/.local/bin/jq
Cheat Sheet
jqis likesedfor JSON data - you can use it to slice and filter and map and transform structured data with the same ease thatsed,awk,grepand friends let you play with text.
All jq selectors begin with . - don't forget that!
Be sure to checkout the official tutorial and jq manual for more info.
You can also try online.
How to select a single a property from an object
echo '{ "name": "foo" }' | jq '.name'
"foo"
How to remove quotes from strings
The -r or --raw-output flag unwraps strings:
echo '{ "name": "foo" }' | jq -r '.name'
foo
How to select a whole object
echo '{ "name": "foo" }' | jq '.'
{
"name": "foo"
}
How to select an element from an array
echo '[ { "name": "foo" } ]' | jq '.[0]'
{
"name": "foo"
}
How to select a single property from an array element
echo '[ { "name": "foo" } ]' | jq -r '.[0].name'
foo
How to select some properties from multiple elements
echo '[ { "name": "foo" }, { "name": "bar" } ]' \
| jq -r '.[].name'
foo
bar
How transform or zip an array
Anything that doesn't start with a . is part of the transformation template.
Anything that collects starts with .[].
Anything that transforms has a pipe and selector | .whatever.
Be sure to checkout the official tutorial and jq manual for more info.
echo '[ { "name": "foo", "age": 0 }, { "name": "bar", "age": 2 } ]' \
| jq '{ names: [.[] | .name], ages: [.[] | .age] }'
{
"names": [
"foo",
"bar"
],
"ages": [
0,
2
]
}