Get the size of an npm package.
npx pkgsz [flags] <package name> [version]
- Node.js 20+
- Uses rollup to build the package (probably more accurate results in modern vite world)
- Reports the statistics regarding node_modules size and minified / gzipped size (brotli compression is optional)
- Supports subpath exports
- Supports custom registries (without authentication)
- Interactive mode
- If you are using something like angular size will be incorrect because this tool does not include the angular compiler (or any other UI framework / library compiler)
- Only reports sizes in binary units (Kib, Mib, bytes)
- Installs using
npm install
and notyarn
/pnpm
/bun
etc.
Interactive mode (default: false)
Calculate brotli compressed size
Do not clean the temporary directory
Do not calculate gzipped size
Reexport given subpath from the package (default: ["."])
The npm registry to use when installing the package
Enable scripts
Output results as JSON
Show help
Show version