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-cleanup

v1.0.4

Published

A Node.js CLI tool to help clean up your local Git branches that have no active upstream branch or whose upstream branch is gone.

Downloads

5

Readme

Git Cleanup CLI Tool

A Node.js CLI tool to help clean up your local Git branches that have no active upstream branch or whose upstream branch is gone. This script assists in removing stale local branches while protecting your default branch (e.g., main or master).

WARNING Branches deleted locally cannot be recovered. If you have any local unsaved work that has not been pushed to a remote repository, IT WILL BE LOST. Use this tool at your own risk. The maintainers assume no responsibility for any data loss. Always review the branches marked for deletion before confirming the cleanup process.

Features

  • Detects Stale Branches:
    Identifies branches that either have no upstream branch or have an upstream branch marked as gone (for example, after a PR is merged and the remote branch is deleted).

  • Default Branch Detection:
    Checks for the existence of local main and/or master branches. If both exist, you will be prompted to select which one you use as your default.

  • Pre-Cleanup Check:
    Before performing any cleanup, if you are not currently on your default branch, you’ll be asked whether you’d like to switch to it or have your current branch excluded from cleanup.

  • Safe and Forced Deletion Options:

    • Safe deletion: Uses git branch -d and warns if a branch is not fully merged.
    • Forced deletion: Uses git branch -D to remove branches that couldn’t be safely deleted.
  • Flexible Cleanup Choices:
    Choose to delete all stale branches, force-delete them, or delete all except your default branch.

Installation

This CLI tool is published on NPM and can be run directly using NPX. Make sure you have Node.js installed.

Usage

Run the following command from the root of any Git repository (i.e., a folder containing a .git directory):

npx git-branch-cleanup