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

git-branch-trimmer

v1.4.1

Published

CLI tool to detect and remove stale Git branches

Readme

Git Branch Trimmer

Git Branch Trimmer Hero

A CLI tool to detect and remove stale local Git branches from your repository.

This tool analyzes your Git branches and helps you identify which ones can be safely deleted, based on whether they have remote counterparts and how long it's been since their last commit.


🛠️ Installation

Install globally using your preferred package manager:

# npm
npm install -g git-branch-trimmer

# pnpm
pnpm add -g git-branch-trimmer

⚙️ Requirements

  • Node.js 16+
  • Git installed on your system

🚀 Usage

Run in any Git repository:

git-branch-trimmer

Optional flags:

# Custom stale threshold in days (default: 30)
git-branch-trimmer --stale-threshold 60

# Dry run mode
git-branch-trimmer --dry-run

# Skip confirmation prompt
git-branch-trimmer --force

What it does:

  1. Scans all local branches
  2. Identifies stale ones based on:
    • Missing remote counterpart
    • Last commit older than the threshold
  3. Presents an interactive menu with:
    • Last commit date
    • Remote tracking info
  4. Safely removes selected branches

📸 Screenshots

1. Branch Detection

2. Confirmation

3. Done!


✨ Features

  • ✅ Detects stale branches based on:
    • No remote
    • Inactivity threshold (default: 30 days)
  • 🧠 Smart, interactive selection
  • 🎛️ Customizable CLI options
  • 🧹 Safe deletion with confirmation
  • 🎨 Clean, colored terminal output
  • 🔧 Works with any Git repo

🧾 Command Line Options

| Option | Description | | ------------------------------ | --------------------------------------------------------------------------- | | -t, --stale-threshold <days> | Set the threshold in days for a branch to be considered stale (default: 30) | | -d, --dry-run | Show what would be deleted without actually deleting | | -f, --force | Skip confirmation prompt |


📄 License

WTFPL