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

gitbroom

v0.1.0

Published

Clean up stale local git branches — merged or whose upstream is gone.

Readme

gitbroom

Clean up stale local git branches — merged or upstream-gone — in one command.

Local branches pile up. You merge a PR, the remote branch gets deleted, but the local copy lingers. Multiply that by every feature you ship and git branch becomes a graveyard. gitbroom finds the dead branches and removes them — safely and with your confirmation.

What it does

Running gitbroom looks for local branches that are either:

  • merged into the default branch (main / master), or
  • gone — their upstream tracking branch was deleted on the remote (the [origin/x: gone] marker in git branch -vv).

It groups them, shows you the list, and asks before deleting anything. The current branch and the default branch are never deleted.

Install

# one-off
npx gitbroom

# or install globally
npm i -g gitbroom
pnpm add -g gitbroom

Requires Node.js >= 18 and git on your PATH.

Usage

gitbroom                 # find candidates, show them, confirm, delete
gitbroom --dry-run       # show what would be deleted, change nothing
gitbroom -y              # delete without the confirmation prompt
gitbroom --merged        # only branches merged into the default branch
gitbroom --gone          # only branches whose upstream is gone
gitbroom --main develop  # override default-branch detection

Tip: gone-branch detection reflects what your local repo knows. Run git fetch --prune first so deleted remote branches are actually marked gone.

Flags

| Flag | Description | | ----------------- | ----------------------------------------------------------------- | | --dry-run | List what would be deleted, then exit. Never deletes. | | -y, --yes | Delete without prompting for confirmation. | | --merged | Only consider branches merged into the default branch. | | --gone | Only consider branches whose upstream is gone. | | --main <branch> | Override default-branch detection (e.g. --main develop). | | -h, --help | Show help and exit. | | -v, --version | Show the version and exit. |

--merged and --gone are mutually exclusive.

Safety guarantees

  • The current branch is never deleted.
  • The default branch is never deleted.
  • Merged branches are removed with git branch -d (the safe delete that refuses to drop unmerged work).
  • A branch whose upstream is gone but which is not merged needs the force delete git branch -D. gitbroom flags these clearly (force delete) so you know what you're agreeing to before confirming.
  • --dry-run changes nothing and is the recommended first run.

Exit codes

| Code | Meaning | | ---- | -------------------------------------------------------------- | | 0 | Success — nothing to do, a dry run, or branches were deleted. | | 2 | Not a git repository, or a git command failed. |

How it's built

The git-touching layer (runGit) is a thin wrapper over child_process. Everything that decides which branches to remove lives in pure functions (parseBranchVV, parseMerged, selectCandidates) that operate on raw git output strings. Those pure functions are what the test suite exercises — the tests never shell out to real git.

License

MIT © 2026 Abdulmunim Jemal