Skip to content

NickCirv/package-size

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

package-size

Know an npm package's install footprint before it lands in your project

License: MIT Zero dependencies Node >=18

Install

npx github:NickCirv/package-size lodash

No global install needed. Works entirely via the npm registry API — downloads and inspects the tarball without touching your node_modules.

Usage

# Analyze a single package
npx github:NickCirv/package-size lodash

# Compare multiple packages side by side
npx github:NickCirv/package-size react vue angular

# Track size growth across the last 5 versions
npx github:NickCirv/package-size axios --history

# Machine-readable JSON output
npx github:NickCirv/package-size moment --json | jq '.[] | {name, unpackedSize}'
Flag Description
--history Show unpacked size trend across the last 5 versions
--json Output machine-readable JSON (pipe-friendly)
--help Show usage

pkgsize is a shorter alias for the binary when installed globally.

What it does

Fetches the package tarball from the npm registry, streams it through a gunzip + TAR header parser, and reports compressed size, unpacked size, file count, and top-10 largest files — all without writing anything to disk. Warns automatically when a package exceeds 5 MB unpacked, 50 MB unpacked, or 1 000 files. Supports side-by-side comparison of multiple packages and a --history mode that checks the last 5 published versions.


Zero dependencies · Node >=18 · MIT · by NickCirv

About

Check an npm package's compressed + unpacked size before adding it — no install required

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors