Skip to content

Instantly share code, notes, and snippets.

@eggplants
Created November 24, 2025 13:33
Show Gist options
  • Select an option

  • Save eggplants/026861e43220801cb8f8b9f5333f9889 to your computer and use it in GitHub Desktop.

Select an option

Save eggplants/026861e43220801cb8f8b9f5333f9889 to your computer and use it in GitHub Desktop.
Convert `pnpm audit --json` into simple list
.actions[].resolves[].id as $id
| .advisories[$id|tostring]
| "\(.severity): \(.module_name): (\(.vulnerable_versions) → \(.patched_versions))"
@eggplants
Copy link
Author

mkdir test
cd test
mise use pnpm node
pnpm init
pnpm add node-fetch@2.0.0
pnpm audit --json | jq -r '
  .actions[].resolves[].id as $id
  | .advisories[$id|tostring]
  | "\(.severity): \(.module_name): (\(.vulnerable_versions) → \(.patched_versions))"
'
high: node-fetch: (<2.6.7 → >=2.6.7)
low: node-fetch: (>=2.0.0 <2.6.1 → >=2.6.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment