How do I view the size of npm packages?

arielorvits picture arielorvits · Nov 16, 2016 · Viewed 54.5k times · Source

When I search for packages on NPM, I would like to see package sizes (in KB or MB, etc). NPM doesn’t seem to show this information.

How can I determine how much bloat an NPM package will add to my project?

Answer

Shubham Kanodia picture Shubham Kanodia · Apr 2, 2017

What you probably want to measure is the impact a package has if you were to add it to your app bundle. Most of the other answers will estimate the size of the source files only, which maybe inaccurate due to inline comments, long var names etc.

There is a small utility I made that'll tell you the min + gzipped size of the package after it gets into you bundle -

https://bundlephobia.com