CLI Tool · npm · Open Source

node-weight

See the real cost of your node_modules — size, security severity, and days since last publish. One command, one table.

⚠ After CanisterWorm (March 2026), knowing your dependency freshness isn't optional
View on npm GitHub Buy Me a Coffee
3
Columns
0
Config needed
Free
Forever
npx
Zero install
"Bundlephobia shows bundle size for the browser. npm audit shows vulnerabilities. But nothing shows me all three — size + security + how old a package is — in one place. So I built it."

What It Looks Like

Real output from running npx node-weight on an actual project

$ npx node-weight
┌─────────────────────────┬──────────┬──────────┬───────────────┐
│ Package                 │     Size │ Security │ Last Updated  │
├─────────────────────────┼──────────┼──────────┼───────────────┤
│ commander               │ 182.0 KB │ ✓ clean  │ 683 days ago  │
├─────────────────────────┼──────────┼──────────┼───────────────┤
│ signal-exit             │  75.2 KB │ ✓ clean  │ 978 days ago  │
├─────────────────────────┼──────────┼──────────┼───────────────┤
│ ora                     │  68.2 KB │ ✓ clean  │ 424 days ago  │
├─────────────────────────┼──────────┼──────────┼───────────────┤
│ emoji-regex             │  47.1 KB │ ✓ clean  │ 2584 days ago │
├─────────────────────────┼──────────┼──────────┼───────────────┤
│ cli-table3              │  45.1 KB │ ✓ clean  │ 689 days ago  │
├─────────────────────────┼──────────┼──────────┼───────────────┤
│ chalk                   │  43.3 KB │ ✓ clean  │ 205 days ago  │
├─────────────────────────┼──────────┼──────────┼───────────────┤
│ @colors/colors          │  38.6 KB │ ✓ clean  │ 1510 days ago │
├─────────────────────────┼──────────┼──────────┼───────────────┤
│ cli-spinners            │  31.4 KB │ ✓ clean  │ 859 days ago  │
├─────────────────────────┼──────────┼──────────┼───────────────┤
│ string-width            │  14.5 KB │ ✓ clean  │ 1651 days ago │
├─────────────────────────┼──────────┼──────────┼───────────────┤
│ get-east-asian-width    │  14.2 KB │ ✓ clean  │ 42 days ago   │
└─────────────────────────┴──────────┴──────────┴───────────────┘

  21 packages | 614.9 KB | 0 vulnerabilities

What Each Column Tells You

Column What it shows Why it matters
Size Total disk size of the installed package directory Pinpoint bloat fast — find which dep is eating your 300 MB node_modules
Security npm audit severity (critical / high / moderate / low / clean) Know at a glance which packages have active CVEs — without parsing npm audit JSON
Last Updated Days since the package was last published to npm Unmaintained packages are supply chain risk — a package last updated 2,584 days ago is a signal

How It Works

01

Reads your project

Scans node_modules/ in the current directory. No config file, no package.json parsing beyond what's installed.

02

Fetches live data

Calls the npm registry API in parallel to get each package's publish date. Runs npm audit once to get security severity per package.

03

Renders a table

Sorts by size descending. Shows total row at the bottom. Color-codes security severity: red for critical/high, yellow for moderate, green for clean.

vs. The Alternatives

Other tools cover one dimension. node-weight covers all three.

node-weight
✓ Size per package
✓ Security severity
✓ Days since publish
✓ Zero install (npx)
✓ Works locally
Bundlephobia
✓ Bundle size (browser)
✕ Security
✕ Freshness
✕ Web only
✕ One pkg at a time
npm audit
✕ Size
✓ Vulnerabilities
✕ Freshness
✓ Built-in
✕ JSON only
depcheck
✕ Size
✕ Security
✕ Freshness
✓ Unused deps
✓ Zero install

Why Now

The CanisterWorm supply chain attack (March 2026) compromised packages that hadn't been updated in years. The maintainers had abandoned them but didn't deprecate or remove them. Thousands of projects were pulling in packages last published in 2019. The "Last Updated" column exists because of this.

Post-CanisterWorm hygiene

Stale packages (1000+ days) are soft supply chain risk. Not necessarily vulnerable today, but a target for account takeovers. Know which ones you're carrying.

Size matters for CI

Slow Docker builds, bloated Lambdas, long cold starts — they often trace back to one massive transitive dependency. Size column surfaces it in seconds.

One command, complete picture

Instead of running npm audit + du -sh + checking registry.npmjs.org by hand, you get everything in a single table from one npx node-weight.

No install required

npx node-weight works without a global install. Nothing added to your package.json. Run it once and forget it, or add it to your CI pipeline.

Run it on your project right now

Zero install. Works on any Node.js project with a node_modules directory. Free and open source.

Install

Zero-install (recommended)

npx node-weight

Run in your project root. Requires Node.js ≥ 18 and an existing node_modules directory.

Global install

npm install -g node-weight

Then run node-weight anywhere, or node-weight /path/to/project to audit a different directory.

CI / package.json script

"scripts": { "audit:weight": "npx node-weight" }

Add to your CI pipeline for a regular dependency health check. Exits 0 always — informational, not blocking.

Also check out mcp-devutils — 45 developer utilities for Claude Desktop & Cursor.