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

port-inspector

v1.1.1

Published

Interactive cross-platform CLI to inspect open/listening ports, the processes behind them, and which Node.js project each one belongs to.

Downloads

568

Readme

Port Inspector

Interactive cross-platform CLI to inspect every open/listening port, the process behind it, and which Node.js project each one belongs to.

Türkçe açıklama aşağıda — Türkçe.

Find out what is running on which port, jump straight to the owning process and project, and kill it — all from an interactive terminal UI. Works on Windows, macOS and Linux.

mode: interactive TUI node >= 20 license MIT

Features

  • 🔎 Lists all listening (and optionally established) TCP/UDP ports with the owning PID, executable and command line.
  • 🟢 Detects Node / Bun / Deno processes and resolves the real project (package.json name + directory), skipping node_modules.
  • 🛠 Labels 40+ common dev servers/tools: Vite, Next.js, NestJS, Nuxt, Angular, SvelteKit, Astro, Remix, Gatsby, Expo, Electron, Hardhat, Prisma, Drizzle, Strapi, Supabase, Fastify, Apollo, Storybook, Vitest, Jest, nodemon, tsx…
  • ⌨️ Interactive TUI: navigate, view details, live search, sort, and act on a process by its port.
  • 🛑 Graceful kill: SIGTERM first, auto-escalate to SIGKILL if it doesn't exit — or force-kill on demand.
  • 🚀 Quick actions: open the project folder, open it in your editor, or copy the command line to the clipboard.
  • 🔁 Live auto-refresh.
  • 🤖 --json output for scripting.

How it works

No fragile netstat text parsing — it reads structured data per platform:

| OS | Source | |----|--------| | Windows | Get-NetTCPConnection / Get-NetUDPEndpoint + Get-CimInstance Win32_Process (via PowerShell, JSON) | | macOS | lsof + ps + lsof -d cwd | | Linux | lsof + /proc/<pid>/{cmdline,exe,cwd} (real working directory) |

Requirements

  • Node.js 20+
  • Windows: PowerShell (pwsh 7+ preferred, falls back to built-in powershell.exe)
  • macOS: works out of the box (lsof is preinstalled)
  • Linux: lsof (sudo apt install lsof / sudo dnf install lsof)

Install

Run without installing

npx port-inspector            # once published to npm

From source (any machine)

git clone https://github.com/mertokan/port-inspector.git
cd port-inspector
npm install
npm link                      # makes the global `ports` command available

After npm link you can run ports from any terminal, any directory. (Run npm unlink -g port-inspector to remove it.)

Tip: instead of npm link you can also npm install -g . from the project folder.

Usage

ports                  # interactive live panel (default)
ports -n               # only Node/Bun/Deno projects
ports --once -p 3000   # who is holding port 3000? (print once and exit)
ports --once -a        # include established connections, not just listeners
ports --json > ports.json

If you didn't run npm link, use node bin/ports.mjs … instead of ports ….

Options

| Option | Description | |---|---| | (none) | Interactive live TUI (default when run in a terminal) | | -o, --once | Print the table once and exit | | --json | Print result as JSON (for scripting) | | -a, --all | Include Established connections, not only listeners | | -n, --node | Show only Node/Bun/Deno processes | | -p, --port <n> | Filter by a specific port | | -i, --interval <s> | Refresh interval in interactive mode (default: 3) | | -h, --help | Help |

Interactive shortcuts

| Key | Action | |---|---| | / or j/k | Move selection | | Enter / d | Toggle detail panel | | x / Del | Kill selected process → e graceful (TERM→KILL) · f force · h cancel | | / | Live search | | s | Cycle sort (port → pid → project → process → proto) | | o | Open the project folder | | e | Open the project in your editor (code / $EDITOR) | | c | Copy the command line to the clipboard | | a | Toggle all connections | | n | Toggle Node-only | | r | Refresh now | | q | Quit |

Clipboard on Linux needs xclip or wl-copy; open folder needs xdg-open.

Development

npm test     # run the unit tests (node:test, no extra deps)

License

MIT — use it however you like.


Türkçe

Port Inspector, bilgisayardaki açık/dinlenen tüm portları, her portun arkasındaki süreci ve özellikle hangi Node.js projesine ait olduğunu gösteren, çapraz platform (Windows, macOS, Linux) interaktif bir terminal aracıdır.

Öne çıkanlar

  • Tüm dinlenen (ve istenirse kurulu) TCP/UDP portları; PID, çalıştırılabilir ve komut satırı ile.
  • Node / Bun / Deno süreçlerini tanır, node_modules'ü atlayıp gerçek projeyi (package.json adı + dizini) bulur.
  • 40+ bilinen dev sunucusunu/aracını etiketler (Vite, Next.js, NestJS, SvelteKit, Hardhat, Prisma, Strapi, Supabase, Fastify, Expo, Electron, nodemon…).
  • İnteraktif arayüz: ok tuşlarıyla gezin, detay gör, canlı ara, sırala ve süreç üzerinde eylem yap.
  • Nazik kapatma: önce SIGTERM, kapanmazsa otomatik SIGKILL — ya da istersen doğrudan zorla.
  • Hızlı eylemler: proje klasörünü aç, editörde aç, komut satırını panoya kopyala.
  • Canlı otomatik yenileme + script için --json.

Kurulum (her makinede)

git clone https://github.com/mertokan/port-inspector.git
cd port-inspector
npm install
npm link        # global `ports` komutu

Artık herhangi bir terminalden ports yazman yeterli.

Gereksinimler

  • Node.js 20+
  • Windows: PowerShell (pwsh 7+ tercih edilir) · macOS: hazır gelir · Linux: lsof

Kullanım

ports                  # interaktif panel
ports -n               # sadece Node projeleri
ports --once -p 3000   # 3000 portunu kim tutuyor?

Kısayollar: ↑/↓ seç · Enter/d detay · x kill (e nazik · f zorla) · / ara · s sırala · o klasör · e editör · c kopyala · a tümü · n node · r yenile · q çık.

Linux'ta panoya kopyalama xclip/wl-copy, klasör açma xdg-open gerektirir.

Geliştirme

npm test     # birim testleri (node:test, ek bağımlılık yok)

Lisans: MIT — dilediğin gibi kullan.