@lowdep/dep-size
v1.0.0
Published
Real disk footprint of npm dependencies — sorted by size, highlights direct deps, zero dependencies
Maintainers
Readme
dep-size
Real disk footprint of your npm dependencies — sorted largest first, direct deps highlighted.
npm outdated tells you what's old. npm audit tells you what's vulnerable. dep-size tells you what's eating your disk.
Why?
bundlephobia measures browser bundle size (after tree-shaking) — not disk size.npm ls shows the dependency tree — not sizes.du -sh node_modules/* is slow, Unix-only, and unsorted.
dep-size scans node_modules directly, sizes every package, and gives you a sorted, colorized breakdown in seconds. Works on Windows, Mac, and Linux. Zero dependencies.
Install
npm install -g dep-sizeOr without installing:
npx dep-sizeUsage
# Top 20 packages by disk size (default)
dep-size
# Top 50
dep-size --top 50
# Only packages larger than 5 MB
dep-size --min 5
# Only direct dependencies from package.json
dep-size --direct
# Analyze a subdirectory
dep-size ./backend
# Export to JSON
dep-size --json > sizes.jsonExample Output
dep-size my-app /path/to/my-app/node_modules
238 packages · 312.4 MB · 48,291 files
Package Size Files % of total
─────────────────────────────────────────────────────────────────────────
● typescript 42.31 MB 1247 13.5% ████████████████░░
● @prisma/client 31.18 MB 892 10.0% ██████████████░░░░
@esbuild/win32-x64 28.44 MB 3 9.1% █████████████░░░░░
● webpack 18.04 MB 645 5.8% ████████░░░░░░░░░░
acorn 12.30 MB 148 3.9% ██████░░░░░░░░░░░░
● lodash 13.20 MB 605 4.2% ██████░░░░░░░░░░░░
● react 2.18 MB 34 0.7% █░░░░░░░░░░░░░░░░░
… and 231 more packages
─────────────────────────────────────────────────────────────────────────
TOTAL 312.4 MB 48,291
● = direct dependency in package.json
Use --top N, --min <mb>, or --direct to filter.Color Legend
| Color | Meaning | |---|---| | Red bar | > 15% of total | | Yellow bar | > 5% of total | | Gray bar | < 5% of total | | Green dot (●) | Direct dependency |
JSON Output
dep-size --json{
"directory": "/path/to/project",
"totalPackages": 238,
"totalSize": 327573504,
"totalFiles": 48291,
"packages": [
{
"name": "typescript",
"size": 44368076,
"files": 1247,
"direct": true
}
]
}License
MIT
Keywords
node_modules size · package size · dependency size · disk usage · heaviest packages · npm package size · bundle weight · analyze node_modules · zero dependencies · cli
Built to solve, shared to help — Rushabh Shah 🛠️✨
One of 40+ zero-dependency developer CLI tools — no node_modules, ever.
