Skip to content

Instantly share code, notes, and snippets.

@gukandrew
Created December 15, 2025 13:04
Show Gist options
  • Select an option

  • Save gukandrew/b91ec978900d8634bf276e8c44142a3c to your computer and use it in GitHub Desktop.

Select an option

Save gukandrew/b91ec978900d8634bf276e8c44142a3c to your computer and use it in GitHub Desktop.
Colorized pnpm dependency version checker for zsh and bash
alias pnpm-deps='pnpm list --depth=0 --json \
| jq -r ".[0].dependencies | to_entries[] | \"\(.key) \(.value.version)\"" \
| while read -r name current; do \
latest=$(pnpm view "$name" version 2>/dev/null); \
if [ -z "$latest" ] || [ "$current" = "$latest" ]; then \
echo "$name - $current"; \
else \
printf "%s - %s%s%s => %s%s%s\n" \
"$name" \
$'\''\033[31m'\'' "$current" $'\''\033[0m'\'' \
$'\''\033[32m'\'' "$latest" $'\''\033[0m'\''; \
fi; \
done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment