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

portcleaner

v1.0.4

Published

A CLI utility that detects and terminates stuck development servers to free ports.

Readme

🧹 PortCleaner CLI

Instantly kill stuck development servers and free your ports.

portcleaner is a lightweight CLI tool that scans your system for running development servers (Node, Bun, Deno, Python, Docker, etc.) and automatically releases the ports they are occupying.

No more:

EADDRINUSE: address already in use :::3000

📦 npm package: https://www.npmjs.com/package/portcleaner


Table of Contents


Why this exists

During development, servers often do not shut down properly:

  • Next.js / React dev servers
  • Express / Fastify APIs
  • Prisma / WebSocket servers
  • Docker containers
  • AI coding agents

Even after closing the terminal, the process keeps running in the background and blocks ports.

Developers repeatedly run:

lsof -i :3000
kill -9 <PID>

portcleaner automates this entire process.


Features

  • Detects active listening ports
  • Finds development servers automatically
  • Safely terminates only dev processes
  • Does NOT affect OS system services
  • Works globally from any directory
  • One-command cleanup

Supported Platforms

| OS | Support | | ---------------------------------- | ------------ | | macOS | Full support | | Linux (Ubuntu, Debian, Arch, etc.) | Full support | | Windows (WSL) | Supported | | Windows PowerShell / CMD | Limited |

Windows users

Windows does not include the lsof utility by default.

Please run the tool inside:

  • WSL (recommended)
  • Git Bash

Quick Install (Recommended)

Install globally from npm:

npm install -g portcleaner

Then run:

cleanports

No configuration needed.


Manual Installation (For Contributors)

If you cloned the repository:

git clone https://github.com/<your-username>/port_cleaner.git
cd port_cleaner
npm install
npm link

Now you can run:

cleanports

Usage

portcleaner

Example:

Scanning for running dev servers...

Found running servers:
• node on port 3000
• docker-proxy on port 5432

Cleaning ports...

Killed node on port 3000
Killed docker-proxy on port 5432

All development ports cleaned!

Use inside your project

Automatically clean ports before starting your app.

Add to package.json:

"scripts": {
  "dev": "portcleaner && next dev"
}

or:

"scripts": {
  "dev": "portcleaner && nodemon src/index.js"
}

Now every time the project starts → ports are freed first.


Uninstall / Disable

To remove the command from your system:

npm uninstall -g portcleaner

If installed via npm link:

npm unlink -g portcleaner

After uninstalling:

cleanports

will no longer work.


Reinstall later

You can enable it again anytime:

npm install -g portcleaner

The command will immediately start working again.


Requirements

  • Node.js 16 or newer
  • macOS or Linux (native)
  • Windows requires WSL or Git Bash

Check:

node -v

How it works

Internally the CLI runs:

lsof -i -P -n | grep LISTEN

It filters development processes such as:

  • node
  • bun
  • deno
  • python
  • docker
  • docker-proxy

Then safely terminates them.


Troubleshooting

cleanports: command not found

Restart terminal or reopen shell.

Nothing was cleaned

Check if a port is actually in use:

lsof -i :3000

Windows not working

Use WSL:

wsl
npm install -g portcleaner
portcleaner

Contributing

Pull requests are welcome. ( Github Repo )

Ideas:

  • port specific cleaning (portcleaner 3000)
  • interactive mode
  • skip database ports (5432, 27017)
  • native Windows support

License

MIT


Author

Created and maintained by Shubhashish Chakraborty For any queries, reach out via email at [email protected].

Twitter GitHub LinkedIn