question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Show non-bundled size (total size on disk)

See original GitHub issue

Type

Feature Request

Request

Some npm packages are not meant to be bundled, such as test tools like ava or tape.

It would be great if bundlephobia could show the size on disk before bundling.

For example, ava and should show 24 MB but it shows 941 kB minified.

I created an issue in https://github.com/siddharthkp/cost-of-modules/issues/50 since it might be out of scope for bundlephobia.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

8reactions
styflecommented, Apr 8, 2018

Here’s what I came up with: https://github.com/styfle/packagephobia

5reactions
styflecommented, Jan 16, 2018

@pastelsky

How would this be helpful for an average developer?

I’m glad you asked! 😃

This information is helpful to an average developer the same way that bundlephobia is helpful to an average front-end developer.

Now I don’t see a “WHY” section to explain the purpose of bundlephobia, but the GitHub subtitle says “Find out the cost of adding a new frontend dependency to your project”.

So my assumption is that bundlephobia is a tool to allow a front-end developer to do a quick comparison of npm package sizes which might affect which dependency you choose to put into your web app. For example, you would want to pick the 1 KB package over that 100 KB package if you had the choice (obviously there are other attributes you would want to look at to make this decision, not just size).

Currently, bundlephobia assumes that npm packages are destined for the browser and shows the size after bundling with webpack.

But that assumption is incorrect. Many packages (in fact node’s original purpose) is meant for back-end developers. It’s also increasingly becoming more popular to use npm packages for your build & test tools.

Now an astute back-end developer or dev ops would want to compare two unit test tools such as ava vs tape and see that ava is 10x larger.

Or how about a micro framework that is larger than it’s competitor zeit micro.

I’ll quote myself from that issue here:

If you add micro as a dependency to a 1000MB mono-repo, then it’s only a 1% increase. If you add micro as a dependency to 500 individual microservices, that’s a 5000MB (5GB) increase in size.

So you see, size matters even for dependencies that are not going to be served to the front-end 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I view the size of npm packages? - Stack Overflow
It shows size in interactive treemap. This helps you to find the size of package in your bundled file. Webpack Bundle Analyzer.
Read more >
Selecting sizes for sparse bundles - The Eclectic Light Company
It's best to do this in consistent units such as MB: if your sparse bundle could reach 1.1 TB, that's 1,100 GB, or...
Read more >
JavaScript performance beyond bundle size - Nolan Lawson
But I believe we focus on bundle size first and foremost because it's easy to measure. That's not to say that bundle size...
Read more >
How do I determine the total size of a directory (folder) from ...
The command du "summarizes disk usage of each FILE, recursively for directories," e.g., du -hs /path/to/directory. -h is to get the numbers "human...
Read more >
Verifying sufficient disk space for a VMware Fusion virtual ...
If you have multiple .vmdk files, add the size of each together to find the total size. For example purposes, let's say you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found