npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

unmerged-branches-weight

v1.1.3

Published

Estimate weight of unmerged Git branches

Readme

unmerged-branches-weight

CLI that scans a Git repository and shows how much disk space every unmerged remote branch eats after compression


Why

Over‑grown feature branches slow down git clone and waste storage. Knowing the worst offenders lets you delete or squash them first

How it works

  1. Collects all commits reachable from every remote branch
  2. Adds commits that are reachable only via tags to a virtual branch called $tags
  3. Calculates compressed diff size in bytes per commit. Compression factor: text - 20%, binary - ~70% (depends on extension, see code)
  4. Sums the numbers per branch and sorts branches by estimated compressed size

Install

# global
npm i -g unmerged-branches-weight

Usage

# one-off run
npx unmerged-branches-weight
# if installed
unmerged-branches-weight
npm run unmerged-branches-weight

Options
  --repo, -r <path>   # path to the Git repository (default = cwd)
  --out, -o <path>    # output directory for the report (default = <repo>/unmerged-branches-size-report)
  --branch, -b <name> # default branch name (master | main) (auto-detect if not provided)
  --no-prompt, -y     # run non‑interactively, use defaults when possible
  --help, -h          # show usage information

Output

<dir>/
  branches_with_commits_and_sizes.json          full stats, biggest first
  branches_with_sizes.json                      branch‑only summary
  commits_with_branches_and_sizes.json          raw per‑commit data

Example entries by report file

branches_with_sizes.json

{
  "branch": "feature/payments‑v2",
  "estCompressedSize": "7.3 MB",
  "textSize": 1834120,
  "binarySize": 19112702
},
{
  "branch": "$tags",
  "estCompressedSize": "6.5 MB",
  "textSize": 694200,
  "binarySize": 9583150
}

branches_with_commits_and_sizes.json

{
  "branch": "origin/feature/forms‑table",
  "estCompressedSizeMB": "12.5 MB",
  "textSize": 10485760,
  "binarySize": 2621440,
  "estCompressedSize": 13107200,
  "commits": [
    {
      "commit": "a1b2c3d4e5f6a7b8c9d0",
      "textSize": 5242880,
      "binarySize": 1310720,
      "estCompressedSize": 6553600
    },
    {
      "commit": "b2c3d4e5f6a7b8c9d0e1",
      "textSize": 5242880,
      "binarySize": 1310720,
      "estCompressedSize": 6553600
    }
  ]
},
{
  "branch": "origin/hotfix/task‑filter",
  "estCompressedSizeMB": "8.4 MB",
  "textSize": 8388608,
  "binarySize": 0,
  "estCompressedSize": 8388608,
  "commits": [
    {
      "commit": "c3d4e5f6a7b8c9d0e1f2",
      "textSize": 4194304,
      "binarySize": 0,
      "estCompressedSize": 4194304
    },
    {
      "commit": "d4e5f6a7b8c9d0e1f2g3",
      "textSize": 4194304,
      "binarySize": 0,
      "estCompressedSize": 4194304
    }
  ]
}

commits_with_branches_and_sizes.json

{
  "commit": "d4e5f6a7b8c9d0e1f2g3",
  "estCompressedSize": 86376400,
  "estCompressedSizeMB": "82.4 MB",
  "textSize": 16760,
  "binarySize": 172752800,
  "branches": ["origin/feature/billing‑update"]
},
{
  "commit": "e5f6a7b8c9d0e1f2g3h4",
  "estCompressedSize": 71963773,
  "estCompressedSizeMB": "68.6 MB",
  "textSize": 54000,
  "binarySize": 102793173
  // commit reachable only via tags, will be placed in "$tags" branch
},
{
  "commit": "f6a7b8c9d0e1f2g3h4i5",
  "estCompressedSize": 14438189,
  "estCompressedSizeMB": "13.8 MB",
  "textSize": 3160,
  "binarySize": 14438013,
  "branches": [
    "origin/feature/billing‑update",
    "origin/bugs/fix-ai-chat-planning-revolution"
  ]
},

Performance

On ~5k commit repo with 250 remotes and 3k unmerged commits the scan finishes in 3-4 min on an SSD

On ~200k commit repo with 4k remotes and 22k unmerged commits the scan finishes in 15-20 min on an SSD

Limits

  • Tested on Node 18+.
  • Windows works via Git‑for‑Windows, macOS/Linux work out of the box
  • Size is an estimate; for byte‑exact numbers use git verify-pack

License

MIT — PRs and issues welcome