https://github.com/kshutkin/package-size
Measure the size of a bundled package and its dependencies
https://github.com/kshutkin/package-size
Last synced: about 2 months ago
JSON representation
Measure the size of a bundled package and its dependencies
- Host: GitHub
- URL: https://github.com/kshutkin/package-size
- Owner: kshutkin
- License: mit
- Created: 2024-07-04T18:01:40.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-04-15T17:03:50.000Z (about 2 months ago)
- Last Synced: 2025-04-15T18:22:48.318Z (about 2 months ago)
- Language: JavaScript
- Size: 639 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Package Size (pkgsz)
[](https://www.npmjs.com/package/pkgsz)
Get the size of an npm package.
## Usage
```bash
npx pkgsz [flags] [version]
```## Requirements
- Node.js 20+
## Example

## :bulb: Features
- Uses rollup to build the package (probably more accurate results in the 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## :bell: Limitations
- 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 not `yarn` / `pnpm` / `bun` etc.## :key: Options
### -i, --interactive
Interactive mode (default: false)
### -b, --brotli
Calculate brotli compressed size
### -c, --no-clean
Do not clean the temporary directory
### -g, --no-gzip
Do not calculate gzipped size
### -e, --export
Reexport given subpath from the package (default: ["."])
### -r, --registry
The npm registry to use when installing the package
### -s, --enable-scripts
Enable scripts
### -j, --json
Output results as JSON### -h, --help
Show help
### --version
Show version
# :information_source: License
[MIT](https://github.com/kshutkin/package-size/blob/main/LICENSE)