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

npm-killer

v1.0.3

Published

Interactive CLI tool to kill Node.js processes on ports

Readme

npm-killer

npm version npm downloads license Node.js version

Interactive CLI tool to find and kill Node.js processes running on ports — Built for developers who run multiple services and need a visual, interactive way to manage port conflicts.


Why npm-killer?

Most port killers (fuser, lsof, kill-port) require you to know the exact PID or port upfront. npm-killer is different:

  • 🎯 Interactive by default — Visual checkbox selection, no memorization needed
  • 🔍 Smart detection — Finds Node.js, npm, yarn, pnpm, bun, Next.js processes automatically
  • 📋 Clean table output — See all processes with ports at a glance
  • Flexible modes — Interactive, list, single-port, or kill-all
  • 🛡️ Safe by default — Confirmation prompts prevent accidental kills
  • 🎨 Developer-friendly — Color-coded, readable output

Installation

# Global install (recommended)
npm install -g npm-killer

# Or use without installing
npx npm-killer

Requirements: Node.js 18+, macOS / Linux / Windows (WSL)


Quick Start

# Interactive mode — select processes with spacebar, press Enter to kill
npm-killer

# List all Node.js processes with ports
npm-killer -l

# Kill process on specific port (with confirmation)
npm-killer -p 3000

# Force kill on port (no confirmation)
npm-killer -p 3000 -f

# Kill all Node.js processes (with confirmation)
npm-killer -a

# Force kill all
npm-killer -a -f

Commands Reference

| Command | Alias | Description | |---------|-------|-------------| | npm-killer | | Interactive mode (default) | | npm-killer --list | -l | List all Node.js processes with ports in a table | | npm-killer --port <port> | -p <port> | Kill process on specific port | | npm-killer --all | -a | Kill all detected Node.js processes | | npm-killer --force | -f | Skip confirmation prompts | | npm-killer --version | -V | Show version | | npm-killer --help | -h | Show help |


Output Examples

Interactive Mode (Default)

$ npm-killer

  Select processes to kill:

  ✓ 1. node                    32724  3001   node /path/to/server.ts
  ✓ 2. next-server (v14.2.35)  48706  3000   next-server (v14.2.35)
  ─────────────────────────────────────────────────────────────
  ◯ Kill ALL Node.js processes
  ◯ Exit without killing

  Kill 2 process(es)? (y/N) y

  ✓ Killed node (PID: 32724)
  ✓ Killed next-server (v14.2.35) (PID: 48706)

List Mode (-l)

$ npm-killer -l

  Node.js Processes with Open Ports:

  #   Name                      PID  Ports  Command
  ─── ──────────────────────  ─────  ─────  ───────
  1   Code Helper (Plugin)    30509  62481  /Applications/VS Code/...
  2   node                    32724  3001   node /project/server.ts
  3   next-server (v14.2.35)  48706  3000   next-server (v14.2.35)
  4   next-server (v16.1.1)   33053  3002   next-server (v16.1.1)

Detected Process Types

npm-killer automatically detects and lists:

  • Node.jsnode, node.js
  • Package managersnpm, yarn, pnpm, bun
  • Frameworksnext-server (Next.js), nuxt, vite, webpack-dev-server
  • TypeScript runnersts-node, tsx, nodemon

Use Cases

  • Microservices development — Multiple services on different ports
  • Frontend + backend — Next.js (3000), API (3001), WebSocket (3002)
  • CI/CD pipelines — Clean up stray processes before deployments
  • Port conflicts — Quickly identify and resolve EADDRINUSE errors
  • Team onboarding — New developers can see running services instantly

How It Works

  1. Uses ps-list to enumerate all running processes
  2. Filters for Node.js-related processes by name and command
  3. Uses lsof to detect listening TCP ports per PID
  4. Presents an interactive UI via inquirer or formatted table output
  5. Sends SIGTERMSIGKILL for graceful then forced termination

Contributing

Contributions are welcome! Please read our contributing guidelines first.

# Clone and install
git clone https://github.com/afzalbuilds/npm-killer.git
cd npm-killer
npm install

# Run tests
npm test

# Build / test locally
npm pack
npm install -g ./npm-killer-*.tgz

Author

Muhammad Afzal — Full-stack Developer & Open Source Enthusiast


License

MIT License — see LICENSE for details.


Made with ❤️ for developers who hate port conflicts.

Star this repo if it saved you time!