What is Bundlephobia?
Bundlephobia tells you the cost of adding an npm package to your website before you install it. You type a package name, such as react, and it shows the size of the package minified and minified plus gzipped, and how long it would take to download on a slow 3G or an emerging 4G connection. That helps you pick a smaller library and keep your site fast.
Each package page also breaks down what the package is made of, lists the gzip size of each export so you can see what tree shaking saves, and suggests similar packages to compare. You can drop in a whole package.json file, or scan one from a URL or GitHub, to check every dependency at once. The official site is bundlephobia.com. It is an open source project under the MIT licence, run by the developer pastelsky on GitHub, and it is free with no account.
Main Features
- Minified and minified plus gzipped size for any npm package
- Download time estimates on slow 3G and emerging 4G
- Size of each export, with a tree shakeable label
- A breakdown of what the package is made of
- Similar packages to compare
- Scan a package.json file by upload, URL or GitHub
- A Trends page to compare downloads, GitHub stars and size history
- Size badges you can add to a README
How to Get Started with Bundlephobia
- Open bundlephobia.com in your browser.
- Type the name of an npm package in the search box.
- Read the minified and gzipped sizes and the download times.
- Scroll down to see the exports and similar packages.
- Use Scan package.json to check all of your project's packages.
Bundlephobia Pricing
Bundlephobia is free, with no account and no paid plan. It is an open source project, and people who find it useful can support it through GitHub Sponsors or Open Collective.
Who Should Use It?
- Front end developers picking between libraries
- Teams trying to make a slow site faster
- Package authors checking how big their package is
- Students learning how JavaScript bundles work
- Reviewers checking a new dependency in a pull request
Bundlephobia Alternatives
- Can I Use checks which browsers support a web feature before you rely on it.
- DevDocs puts the docs for many languages and libraries in one fast, searchable place.
- Squoosh shrinks images, the other big part of a heavy page.
Frequently Asked Questions
Is Bundlephobia free?
Yes. Bundlephobia is free to use, with no account and no paid plan.
What does Bundlephobia measure?
It shows how big an npm package is when minified and gzipped, how long it takes to download, and the size of each export.
Can Bundlephobia check my whole project?
Yes. Drop your package.json file on the scan page, or scan one from a URL or GitHub, to see every dependency.
Is Bundlephobia open source?
Yes. The code is on GitHub at pastelsky/bundlephobia under the MIT licence.
Why does a package show a build error?
Often the package needs another package it does not list in its own dependencies, so Bundlephobia cannot build it. The project's GitHub page explains the common errors.
