@wuyuchentr/package-size-check
v1.0.0
Published
Estimate an npm package's compressed + uncompressed size before installing.
Maintainers
Readme
@wuyuchentr/package-size-check
Check an npm package's size before installing it. Shows compressed (tarball) + unpacked size + file count.
Usage
npx package-size-check lodash
npx package-size-check lodash express react
npx package-size-check --json lodashExample output
Package Compressed Unpacked Files
-----------------------------------------------
lodash 315.6 KB 1.4 MB 1051
express 212.1 KB 1.2 MB 262
react 6.7 KB 66.9 KB 10Options
| Flag | Description |
|------|-------------|
| --json | Output as JSON |
How it works
- Fetches package metadata from
registry.npmjs.org - Reads
dist.unpackedSizeanddist.fileCountfrom the registry - Makes a GET request to the tarball URL and reads the
Content-Lengthheader (then aborts — no download) - Zero dependencies, pure Node.js built-ins
