How do I view the size of npm packages?

后端 未结 10 1740
故里飘歌
故里飘歌 2020-12-22 16:53

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 bloa

10条回答
  •  清酒与你
    2020-12-22 17:31

    A "quick & dirty" way is to use curl and wzrd.in to quickly download the minified package and then grep the file size:

    curl -i https://wzrd.in/standalone/axios@latest | grep Content-Length

    The download is minified but not gzipped, but you get a good idea of the relative size of packages when you compare two or more of them.

提交回复
热议问题