npm/www

[Feature Request] Display package size

coagmano opened this issue · 3 comments

It would be great to have an indication of package size when browsing npm to select a package.
Sometimes a feature can be achieved in a few kb, but you end up with a huge package that goes unused.

One particularly bad example is the jQuery-UI package which comes in at 16mb, and I didn't realise till I was looking through the folder to import just the component I needed. (They bundle many, many versions of jQuery in the package for some stupid reason)

I am considering writing a tool to do this.
There is already https://bundlephobia.com which is great for front end dependencies that get bundled with webpack but it doesn't tell you about the size of dev dependencies such as test frameworks.

There's also a great plugin for VSCode that does this:
https://marketplace.visualstudio.com/items?itemName=wix.vscode-import-cost

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

You can see that jquery-ui is 13 MB before you install it 😃