A CLI tool to estimate the bundle size of browser-compatible npm modules by downloading, bundling with browserify or concat, minifying with uglify/closure/babili/butternut, and optionally gzipping. Current stable version is 5.1.0. It supports various module identifiers (scoped packages, submodules, versions) and outputs uncompressed, minified, and gzipped sizes. Key differentiator: simple one-command bundle size estimation without setup. Release cadence is low (last major release 2017). Note: Only works with CommonJS modules, not ESM.
npm install weighNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows typical usage: install globally, get sizes for a package, submodule, and custom bundling.
Use the default minifier (uglify) or switch to 'closure' or 'babili'.
Use --development flag to compare sizes.
Ensure the package is compatible with CommonJS or use esm bundler workaround.
Install globally with npm i -g weigh.
Reinstall globally: npm i -g weigh
Install globally: npm i -g weigh