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

portmon

v1.0.3

Published

Cross-platform CLI to list listening ports and kill processes by port or PID

Readme

portmon

Cross-platform CLI to list listening ports, see which process owns them, and kill processes by port or PID.

Works on Windows, macOS, and Linux.

npm version license

Install

npm install -g portmon

Or run without installing:

npx portmon list

Quick start

# List all listening TCP ports
portmon

# Who is using port 3000?
portmon find 3000

# Kill the process on that port
portmon kill 3000 -y

# Interactive live view
portmon watch

Commands

list (default)

List listening ports.

portmon
portmon list
portmon ls
portmon list --udp      # include UDP
portmon list --json     # JSON output

find / who

Show which process is listening on a port.

portmon find 3000
portmon who 5173
portmon find 3000 5173   # check multiple ports
portmon find 3000 --json

kill

Kill the process listening on a port.

portmon kill 3000       # prompts for confirmation
portmon kill 3000 -y    # skip confirmation
portmon kill 3000 -f -y # force kill

kill-pid

Kill a process by PID.

portmon kill-pid 12345
portmon kill-pid 12345 -f -y

watch / w

Interactive live view of listening ports.

portmon watch
portmon watch -i 1000   # refresh every 1 second
portmon watch --udp

| Key | Action | |-----|--------| | / | Move selection | | j | Move down | | Enter / d / k | Kill selected process | | f / K | Force-kill selected process | | r | Refresh now | | q / Ctrl+C | Quit |

The list auto-refreshes (default every 2s). Selection stays on the same port and PID across refreshes when possible.

Requires an interactive terminal (TTY).

Example output

┌──────┬───────┬──────────┬──────────┬───────────┐
│ PORT │ PID   │ PROCESS  │ PROTOCOL │ ADDRESS   │
├──────┼───────┼──────────┼──────────┼───────────┤
│ 3000 │ 14204 │ node.exe │ TCP      │ 0.0.0.0   │
│ 5173 │ 9188  │ node.exe │ TCP      │ 127.0.0.1 │
└──────┴───────┴──────────┴──────────┴───────────┘

2 listening port(s)

How it works

| OS | Discovery | Kill | |----|-----------|------| | Windows | netstat -ano + tasklist | taskkill | | macOS | lsof | SIGTERM / SIGKILL | | Linux | lsof (fallback: ss) | SIGTERM / SIGKILL |

No native addons — only Node.js and standard OS tools.

Requirements

  • Node.js 18 or later
  • On macOS/Linux, lsof is recommended (ss is used as a Linux fallback)

Permissions

Killing system services or processes owned by another user may require an elevated shell (Administrator on Windows, sudo on Unix). Clear errors are shown when a kill is denied.

Development

git clone https://github.com/alaminrifat/portmon.git
cd portmon
npm install
npm run dev -- list
npm run build
node dist/cli.js list

See CONTRIBUTING.md for setup details, guidelines, how to submit pull requests, and how maintainers release new versions to npm.

License

MIT