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

branchreap

v0.1.0

Published

Safely reap merged & gone-upstream git branches — clean up your local branch clutter in one pass. Zero dependencies, no install.

Downloads

21

Readme

branchreap

Safely reap merged & gone-upstream git branches. After a few months, git branch becomes a graveyard: dozens of feature/* that shipped long ago, and tracking branches whose remote was deleted the moment the PR merged. branchreap finds the ones that are actually safe to delete — and only those. Zero dependencies, nothing to install.

# See what's reapable (read-only):
npx branchreap

# Reap it (asks first):
npx branchreap clean

What it reaps

  • Merged branches — local branches fully merged into your default branch.
  • Gone branches — tracking branches whose upstream was deleted ([gone]), as long as they carry no unmerged work.

What it will never touch

  • the current branch
  • the default branch (main / master / whatever origin/HEAD points at)
  • unmerged or unpushed work, or any branch with commits of its own — unless you explicitly pass --include-unmerged (and even then, never the current or default branch)

That safety floor is the whole point: run it without reading the docs and the worst case is it deletes a branch git itself considers fully merged.

Why not git branch --merged | xargs git branch -d?

Because that one-liner misses gone-upstream branches, happily lists main, and does nothing about the "is this actually safe?" question. branchreap does merged and gone in one pass, protects the branches you'd regret losing, and runs instantly with npx (or pip/pipx — there's a twin Python package), no toolchain to install.

Usage

branchreap                      # scan (read-only, default)
branchreap scan --json          # machine-readable
branchreap clean --dry-run      # preview exactly what would be deleted
branchreap clean                # delete, with a confirmation prompt
branchreap clean --yes          # delete, no prompt (scripts / aliases)

Options

--main <branch>       Override the detected default branch
--fetch               Run 'git fetch --prune' first, so 'gone' status is fresh
--include-unmerged    Also reap gone branches with unmerged commits (uses -D)
--json                Machine-readable scan output
-y, --yes             Skip the confirmation prompt
--dry-run             Show what would be deleted, delete nothing

--fetch is worth knowing: git only marks an upstream gone after a prune, so branchreap --fetch refreshes that first if you haven't fetched in a while.

Example

$ branchreap

default branch: main

  ✗ feature/old-login          merged         merged into main
  ✗ fix/typo                    gone           upstream gone · merged into main
  ────────────────────────────────────────────────────────
  2 reapable  (1 merged · 1 gone)  ·  4 kept

  1 gone branch(es) held back (unmerged commits). Use --include-unmerged to reap.

Exit codes

| Code | Meaning | |------|---------| | 0 | ok | | 2 | error (not a git repo, bad args, or a deletion failed) |

Also available for Python

pip install branchreap (or pipx run branchreap) — same tool, same flags, same output. See branchreap-py.

License

MIT