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

portmanager-tui

v0.3.0

Published

TUI to view open ports, search, and kill processes on Linux, macOS, and Windows

Readme

portmanager-tui

A simple TUI to view open ports on Linux, macOS, and Windows with their processes, search them, and kill processes straight from the terminal.

Usage (local, before publishing to npm)

cd portmanager-tui
npm install
npm link          # registers the "portmanager-tui" bin globally (symlink)
npx portmanager-tui

npm link only needs to run once. After that, npx portmanager-tui will call this local version from any directory. To publish it later so npx portmanager-tui works without cloning, just npm publish (make sure the package name isn't taken).

Alternative without linking, run directly:

node bin/index.js

Controls

| Key | Action | |---|---| | ↑ / ↓ or j / k | Navigate rows | | / | Open search — type then Enter to filter (matches port, process name, PID, owner, or address), Esc to cancel | | o | Toggle: only show ports owned by your user / show all | | d | Kill selected process (SIGTERM) | | D | Force kill selected process (SIGKILL) | | r | Manual refresh | | q / Ctrl+C | Quit |

Data auto-refreshes every 4 seconds (except while typing a search).

By default only ports whose process is owned by the user running the tool are shown (compared via uid). Press o to see all ports.

Notes

  • Platform support:
    • Linux — uses ss -tulnp (part of iproute2, usually installed by default on modern distros). The Owner column is read from /proc/<pid> (no ps spawn per row) and mapped to a username via /etc/passwd, so it stays cheap even with many ports.
    • macOS — uses lsof -i -P -n (preinstalled on macOS). The Owner column comes straight from lsof's USER field; the uid is resolved once per unique username via id -u and cached.
    • Windows — uses netstat -ano for the port list and Get-Process (via PowerShell) for the process name and session ID. Only listening TCP ports and UDP ports are shown (established/close-wait connections are filtered out to keep the table focused). The own-only filter identifies your processes by matching the Windows session ID (same session as the tool itself) — no admin required. Kill uses taskkill /T (tree kill), with /F for force kill.
  • To see all processes (including other users / root), run with sudo (Linux/macOS) or an elevated terminal (Windows):
    sudo npx portmanager-tui
    Without elevated privileges, ports owned by other processes show PID/Process as -.

Structure

portmanager-tui/
├── bin/index.js     # entry point — UI + keybindings
├── lib/
│   ├── linux.js     # Linux data layer (ss + /proc)
│   ├── macos.js     # macOS data layer (lsof)
│   └── windows.js   # Windows data layer (netstat + Get-Process)
├── package.json
└── README.md