Get sizes of installed packages #10361
Comments
Related to #4638, although the scope of this issue is larger. Another thought on this... it would be best to right-align the module size. That would make it much easier to read and compare sizes. For example.
|
Well this is in the works: #9920 |
I put together https://github.com/mikermcneil/kit#kit-deps as a stopgap for this in case it's helpful for anyone (cc @davej) |
(see also @siddharthkp's |
@mikermcneil Thanks for the mention! ❤ |
Also, if you're more interested in the size impact of a module post bundling and minifying, rather than its size on disk, I wrote a small online utility that can tell you that- EDIT: It's now moved to https://bundlephobia.com |
Could you not just use |
From cost-of-modules readme:
Exactly what you suggested. But,
You will not get the next level dependencies, because it's all flat. |
We're closing this issue as it has gone thirty days without activity. In our experience if an issue has gone thirty days without any activity then it's unlikely to be addressed. In the case of bug reports, often the underlying issue will be addressed but finding related issues is quite difficult and often incomplete. If this was a bug report and it is still relevant then we encourage you to open it again as a new issue. If this was a feature request then you should feel free to open it again, or even better open a PR. For more information about our new issue aging policies and why we've instituted them please see our blog post. |
For those interested, I've created npm-download-size which resolves dependencies and calculates size for tarballs without downloading any packages. The total size of all tarballs gives you a good estimate if a given package is bloated. The cli tool can be used like this:
|
With npm 2.x, I could do easily go into the node-modules folder and inspect a folder to find out the modules' size on disk. With npm 3 and flat deps this isn't possible (it's not that unusual for the node_modules dir of a large project to have 1,000+ directories).
This isn't a big problem for most node applications but when using something like Electron it's important to have a handle on the size of modules so that you can keep the final binary size as small as possible.
Possible API:
The text was updated successfully, but these errors were encountered: