Bundlephobia answers the question every dependency deserves: “what will this cost my users?” Type a package name and it reports minified and gzipped size, estimated download time on slow networks, whether it’s tree-shakable, and which of its own dependencies are doing the damage. It turns dependency selection from faith into arithmetic.
Where it shines
- Pre-install judgment. Catch a 400 kB date library before it enters the lockfile - the cheapest moment to say no is before
npm install. - Alternatives panel. It surfaces similar packages ranked by size, which is exactly the nudge you need when three libraries do the same thing.
- AI-codeballast detector. Agents love famous-but-heavy packages; a quick size check keeps generated
package.jsonfiles honest.
Where it falls short
- Client-side focus: server-only package size is mostly irrelevant, and the tool doesn’t say which is which.
- Numbers assume bundler defaults; your actual tree-shaking results may be better or worse.
The real cost
Free. It occasionally costs you your favorite library - which was probably the point.
Verdict
Make it a rule: no new frontend dependency without a Bundlephobia check. Ten seconds per package, kilograms saved per release.