gitmyhub

jsize

JavaScript ★ 4 updated 9y ago ⑂ fork

Find out minified and gzip npm package size.

A command-line tool that shows the real size of any npm package, both minified and gzip-compressed, before you commit to installing it.

Node.jsCLInpmsetup: easycomplexity 1/5

Understanding jsize

jsize is a command-line tool that tells you how much space npm packages take up. When you install a package from npm, it's often larger than necessary—it might include extra code for features you won't use, or it might not be compressed for web delivery. This tool shows you the real footprint: both the minified size (stripped of unnecessary characters) and the gzip size (what you'd actually download in a web browser). It takes the guesswork out of whether a package is lightweight or bloated.

You install it once globally on your computer, then run it from the terminal to check any package. You can check a single package like jsize jquery, or multiple packages at once like jsize react react-dom lodash. It even works with scoped packages (packages with an @ prefix, common in larger projects) and lets you drill down to individual files inside a package if you want to see which parts are taking up space. Results come back instantly with a green checkmark and the size in kilobytes.

The main audience would be developers building web applications who care about bundle size—either to make their app faster to download, or to choose between competing packages. A frontend engineer might run jsize before deciding whether to use lodash or a lighter alternative. A team lead might use it to audit which dependencies are pulling in the most weight. It's especially useful when peer dependencies are involved: if you're checking a package like react-dom that needs react to work, you can check both at once to see their combined impact.

The tool is straightforward to use but has a --verbose flag if you want more detail: it'll show you the initial size before any optimization, the minified size, and the final gzip size side by side. This helps you understand how much gets cut away at each stage of the build process.

Where it fits