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

@ma.vu/killport

v1.2.14

Published

CLI tool to kill processes on a port

Readme

killport

npm

Supported: Linux, macOS, Windows

A CLI tool to kill processes running on a specific port. No more googling "how to kill port 3000".

Installation

npm install -g @ma.vu/killport
pnpm add -g @ma.vu/killport
bun add -g @ma.vu/killport

Or run directly without installing:

npx @ma.vu/killport 3000
bunx @ma.vu/killport 3000

Usage

# Kill process on port 8080
killport 8080

# Force kill (SIGKILL instead of SIGTERM)
killport 8080 --force
killport 8080 -f

# List all listening ports
killport --peek
killport -p

Examples

Kill a stuck development server:

$ killport 3000
Killed process 12345 on port 3000

Nothing running? Get a hint:

$ killport 9999
Nothing running on port 9999
Hint: use --peek or -p to see all listening ports

See what's listening:

$ killport --peek
Listening ports:
  3000 - node (pid 12345)
  5432 - postgres (pid 67890)
  8080 - java (pid 11111)

Options

| Option | Short | Description | |--------|-------|-------------| | --force | -f | Force kill using SIGKILL instead of SIGTERM | | --peek | -p | List all processes listening on ports |

Philosophy

Zero runtime dependencies. The only dev dependency is esbuild for bundling into a single file.

Requirements

  • Node.js 18+
  • macOS, Linux, or Windows

License

ISC


Implementation Notes

This tool needs to: (1) find which process owns a port, and (2) kill it.

Why netstat instead of lsof?

  • lsof is Unix-only (macOS/Linux)
  • netstat exists on all platforms (Windows, macOS, Linux)
  • One tool, platform-specific flags:
    • Windows: netstat -ano
    • macOS: netstat -anv
    • Linux: netstat -tlnp

Why process.kill() instead of shell commands?

  • Node's built-in process.kill(pid, signal) works cross-platform
  • No need to shell out to kill (Unix) or taskkill (Windows)
  • Cleaner, fewer moving parts

Why not pure Node.js for port detection?

  • Node has no API to query "which process owns port X"
  • net module can check if a port is busy, but not WHO owns it
  • OS-level tools like netstat are required for PID discovery

LLM Context

This section helps AI assistants understand the project structure. See also llm.txt.

Purpose: CLI tool to find and kill processes occupying network ports on macOS, Linux, and Windows.

Structure:

killport/
├── bin/cli.js      # CLI entry point, argument parsing
├── lib/kill.js     # Core logic: findProcessOnPort, killPort, peekPorts
├── test/cli.test.js # Tests using node:test
└── package.json

Key functions in lib/kill.js:

  • findProcessOnPort(port) - Returns array of PIDs using the port
  • killPort(port, { force }) - Kills process on port, returns boolean
  • peekPorts() - Returns array of { command, pid, port } for all listening ports

Tech: Pure Node.js, no dependencies. Uses netstat for port detection and process.kill() for termination.

Testing: npm test runs tests via Node's built-in test runner (node:test).