Skip to content

Cookbook

  • curl
  • fzf (for scripts that require interactivity)
  • jq

View all package versions

sh
curl https://packages.stephansama.info/meta.json --silent |
 jq -r 'map(select(.name | test("@stephansama"))) | map(.name + " - v" + .version) | .[]'

Get package.json of a specific package

sh
(tmp=$(curl https://packages.stephansama.info/meta.json --silent) &&
 selected=$(echo "$tmp" | jq -r 'map(select(.name | test("@stephansama"))) | map(.name) | .[]' | fzf) &&
 echo "$selected" &&
 echo "$tmp" | jq -r ".[] | select(.name == \"$selected\")")

Get scripts of a specific package

sh
(tmp=$(curl https://packages.stephansama.info/meta.json --silent) &&
 selected=$(echo "$tmp" | jq -r 'map(select(.name | test("@stephansama"))) | map(.name) | .[]' | fzf) &&
 echo "$selected" &&
 echo "$tmp" | jq -r ".[] | select(.name == \"$selected\") | .scripts")

Get dependencies of a specific package

sh
(tmp=$(curl https://packages.stephansama.info/meta.json --silent) &&
 selected=$(echo "$tmp" | jq -r 'map(select(.name | test("@stephansama"))) | map(.name) | .[]' | fzf) &&
 echo "$selected" &&
 echo "$tmp" | jq -r ".[] | select(.name == \"$selected\") | {dependencies, devDependencies,peerDependencies}")

View all example versions

sh
curl https://packages.stephansama.info/meta.json --silent |
 jq -r 'map(select(.name | test("@example"))) | map(.name + " - v" + .version) | .[]'

Released under MIT license