Get the bundle size of npm packages by installing and bundling them with Webpack.
package-size is a Node.js CLI tool that calculates the bundle size of npm packages by installing them in a temporary directory and bundling with Webpack. It provides accurate size measurements including minified and gzipped sizes, helping developers assess the impact of dependencies on application performance.
Frontend and JavaScript developers who need to optimize bundle sizes, library authors wanting to track their package's footprint, and teams focused on performance-aware dependency management.
It offers a realistic simulation of how packages contribute to final bundle sizes, supports multiple packages and versions, and provides both CLI and programmatic API for integration into build processes or analysis workflows.
Get the bundle size of an npm package.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Webpack to bundle packages in a temporary directory, providing realistic size measurements including minified and gzipped sizes, as shown in the CLI output examples like `size: 12023` in bytes.
Supports analyzing single packages, multiple packages (e.g., `react,react-dom`), and even different versions of the same package, allowing comprehensive dependency comparisons.
Offers a Node.js API for programmatic use, enabling integration into build processes or CI/CD pipelines, as demonstrated in the API section with `getSizes` function.
Integrates with webpack-bundle-analyzer via the `--analyze` flag, providing visual insights into bundle composition for debugging and optimization.
Relies exclusively on Webpack for bundling, which may not accurately represent sizes with other popular bundlers like Rollup or Parcel, limiting cross-tool applicability.
Requires installing each package in a temporary directory for every analysis, making it slower and more resource-heavy than tools that use cached estimates or metadata.
The README only mentions installation with yarn or npm, so it may have compatibility issues or lack optimizations for newer package managers like Yarn 2 or pnpm.