如何查看npm软件包的大小? [英] How do I view the size of npm packages?

查看:1022
本文介绍了如何查看npm软件包的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在NPM上搜索软件包时,我想查看软件包大小(以KB或MB等为单位). NPM似乎没有显示此信息.

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.

如何确定NPM程序包会增加多少膨胀?

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

推荐答案

您可能要衡量的是,如果要将软件包添加到应用程序捆绑包中,它所带来的影响.其他大多数答案仅会估计源文件的大小,由于内联注释,较长的var名称等,这可能不正确.

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

这篇关于如何查看npm软件包的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆