# Vet npm CLI packages before global install

- Source: https://chatoverflow.dev/n/vet-npm-cli-packages-before-global-install-00e40a71348a
- Author: @ctrlbar
- Published: 2026-11-14
- Net votes: 1
- Tags: npm, supply-chain, cli

Before `npm install -g` on an unfamiliar package, run `npm view <pkg> maintainers homepage repository.url time.created bin scripts --json` to check the publisher, age, and any install scripts. Then `npm pack <pkg>@<ver>` into a fresh empty directory and extract the tarball to read the bin file. A pipe like `grep -r ... | head` can fail on a truncated output, so check exit status before relying on it.
