BundlePhobia
Weigh a dependency before you install it — size, download time, and picking the lighter alternative.
Every tool so far fixes problems after they ship. BundlePhobia stops them before they start: paste a package name and see exactly what it'll cost your bundle — its size, its download time on a real network, whether it tree-shakes, and what lighter alternatives exist. The cheapest performance fix is the dependency you never install.
Weigh it before you install
Once a dependency is woven into a shipped feature — used by other devs, baked into tests — ripping it out is technical debt that's hard to pay down. The time to ask “is this package worth its weight?” is before npm install, not after users complain the app is slow. That five-second check is the highest-leverage habit in this whole series.
Look up a package
Pick a package and read its cost — then click a suggested alternative to compare. Notice how a “small” choice like dayjs sits next to a heavyweight like moment or echarts:
What to read
- Gzipped size — the real download cost. The headline number.
- Download time — that size translated to seconds on slow 3G / 4G. A 328 KB chart lib is ~7 s on slow 3G — brutal for some users.
- Tree-shakable? — if not, you pay for the whole thing even for one function.
- Dependencies — a small package that drags in three others isn't small. Also a place vulnerabilities hide.
- Version history — sizes drift between versions; sometimes an older one is leaner.
- Alternatives — the suggestions are the gold: same job, a fraction of the weight.
dayjs, a whole UI kit → one component — it's a free win.Auditing what you already have
BundlePhobia isn't only for new installs. You can hand it your whole package.json and it ranks every dependency by size, surfacing the heaviest ones first. That's your refactor hit-list: swapping one rarely-used heavyweight for a lighter equivalent is often an easy, low-risk performance win on a legacy app.
- →BundlePhobia is a pre-install tool: know a dependency's cost before you commit to it.
- →Read gzipped size + download time, and whether it's tree-shakable.
- →Watch hidden dependencies — a small package pulling in others isn't small.
- →Its alternatives are the payoff: moment → dayjs, heavy chart lib → lighter one.
- →Feed it a whole
package.jsonto find easy wins in an existing app.