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

@harsha1029/portkill

v1.0.1

Published

Cross-platform CLI tool to kill any process running on a specific port with zero dependencies.

Readme

portkill

Fast, cross-platform CLI tool to kill whatever process is holding your port hostage. Zero dependencies.

npm version license


The Problem

Developers constantly hit port already in use errors when launching local development servers:

Error: listen EADDRINUSE: address already in use :::3000

Fixing this normally requires manually looking up platform-specific terminal commands, finding the process ID (PID) occupying that port, and terminating it:

  • On macOS / Linux: lsof -i tcp:3000 -> copy PID -> kill -9 <PID>
  • On Windows: netstat -ano | findstr :3000 -> find PID -> taskkill /PID <PID> /F

It's tedious, error-prone, and interrupts your workflow.


The Solution

A single command that frees up your port across macOS, Linux, and Windows:

portkill 3000

Features

  • ⚡ Zero External Dependencies: Built strictly using Node.js standard modules (child_process, os).
  • 🌐 Cross-Platform: Seamlessly works on macOS, Linux, and Windows.
  • 🎯 Multiple PID Support: Cleans up all processes if multiple listeners are bound to the same port.
  • 🛡️ Accurate Matching: Targets the exact port without false positives on similar port numbers or foreign connections.
  • 💡 Graceful Exits: Clear status reporting and exit code 0 when no process is occupying the port.

Installation

Global Install (Recommended)

npm install -g @harsha1029/portkill

Run Instantly via npx

Without installing globally:

npx @harsha1029/portkill 3000

Usage

portkill <port>

Examples

Kill process running on port 3000:

portkill 3000

Kill process running on port 8080:

portkill 8080

Show help:

portkill --help

How It Works

Under the hood, portkill detects your operating system and executes the native commands directly:

  • macOS / Linux: Uses lsof -i tcp:<port> -sTCP:LISTEN -t to locate the listening PIDs, followed by kill -9 <pid>.
  • Windows: Uses netstat -ano | findstr :<port> to locate the listening PIDs, validates the local address, and runs taskkill /PID <pid> /F.

Permissions & Privileges

If a process is owned by a system user or another privileged service, run the command with elevated rights:

  • macOS / Linux: sudo portkill <port>
  • Windows: Run your terminal (Command Prompt / PowerShell / Windows Terminal) as Administrator.

Contributing

Pull requests are welcome! If you encounter issues or have suggestions, feel free to open an issue on GitHub.


License

MIT