Hey folks, I’m trying to keep my project lean and mean. I was wondering if there’s a quick way to see how big npm packages are before I add them to my project. I’ve been poking around the npm website, but I can’t seem to find any info on package sizes.
Does anyone know a trick for this? I’m looking for something that shows the size in KB or MB. It’d be super helpful to know how much each package might bulk up my project.
I heard there might be some new features coming to show this info in the CLI. Has anyone tried that out yet? Or do you have any other tools you use to check package sizes?
Thanks in advance for any tips!
yo, check out ‘npm-size’ cli tool. it’s pretty sweet for this. just npm install -g npm-size, then run npm-size packagename. gives u size info real quick. helped me trim down my project big time. Another option is bundlephobia website, but the cli is faster imho
As someone who’s been in your shoes, I’ve found a couple of reliable ways to check npm package sizes. My go-to tool is ‘package-size’ - it’s a lifesaver. Just run ‘npx package-size packagename’ in your terminal, and it’ll show you the size breakdown.
Another trick I’ve picked up is using Bundlephobia (bundlephobia.com). It’s a web-based tool where you can search for any npm package and get detailed size info, including gzipped size and download times.
For a more integrated approach, I’ve started using ‘import-cost’ extension in VS Code. It shows package sizes right in your editor as you code - super handy for keeping track on the fly.
These methods have helped me keep my projects slim. Hope this helps you out too!