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

@404-pf/git-broom

v0.1.0

Published

A safety-first CLI tool to clean up stale branches, prune dangling Git objects, and keep your repositories tidy.

Readme

🧹 Git Broom

A safety-first CLI tool to automatically clean up stale branches, prune dangling Git objects, and keep your repositories tidy.

Features

  • Dry-run by default — see what would happen before any changes are made
  • Protected branches — never delete main, master, develop, or custom patterns
  • Safety guards — current branch is always skipped, confirmation prompts before deletion
  • Stale branch detection — configurable inactivity threshold (default: 90 days)
  • Dangling object pruning — clean up unreachable commits, trees, and blobs
  • Repository status report — quick overview of branch hygiene and .git size

Installation

npm install -g git-broom

Or run locally from the project:

npm run dev -- [command]

Usage

git-broom status          # Show repository hygiene report
git-broom clean           # Clean stale branches (dry-run by default)
git-broom branches        # List branches by state
git-broom objects         # Inspect dangling objects

Global Options

| Option | Description | Default | |--------|-------------|---------| | --repo <path> | Target repository directory | cwd | | --dry-run | Show what would happen | true | | --no-dry-run | Apply changes | — | | --yes | Skip confirmation prompts | false | | --aggressive | Deep clean with aggressive GC | false | | --verbose | Show debug output | false |

Commands

status

Show a quick report of your repository's health:

🧹 Repository Status
────────────────────────────────────────
Current branch         main
Total branches         12
Merged branches        5
Stale branches (>90d)  3
Dangling objects       47
Remotes                origin
.git size              15.2 MB

clean

Orchestrate a full cleanup:

  1. Prune remote tracking branches
  2. Delete merged local branches
  3. Delete stale branches (configurable days)
  4. Run garbage collection
git-broom clean                    # Dry run (default)
git-broom clean --no-dry-run       # Apply changes
git-broom clean --yes              # Skip confirmation
git-broom clean --stale-days 30    # Custom stale threshold
git-broom clean --aggressive       # Aggressive GC

branches

List branches categorized by state:

git-broom branches                 # All branches
git-broom branches --merged        # Only merged
git-broom branches --stale         # Only stale
git-broom branches --stale-days 60 # Custom threshold

objects

Inspect and prune dangling Git objects:

git-broom objects                  # Show dangling objects
git-broom objects --prune          # Remove them
git-broom objects --prune --aggressive  # Aggressive cleanup

Configuration

Create a .gitbroomrc file in your repository or home directory:

{
  "protectedBranches": ["main", "master", "develop", "release-*"],
  "staleDays": 60,
  "dryRun": true,
  "aggressive": false,
  "skipConfirmation": false,
  "verbose": false
}

Safety

Git Broom is designed with safety as the top priority:

  • Dry-run is the default — nothing is deleted unless you explicitly use --no-dry-run
  • Protected branchesmain, master, develop, and user-configured patterns are never deleted
  • Current branch — the checked-out branch is always skipped
  • Confirmation prompts — interactive confirmation before any deletion (skip with --yes)
  • Remote pruning — remote tracking branches are pruned before evaluating staleness

Development

npm install          # Install dependencies
npm run dev -- help  # Run in development mode
npm run build        # Build for production
npm run typecheck    # TypeScript type checking
npm test             # Run tests

License

MIT — see LICENSE