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

peekport

v0.1.0

Published

See what's using a TCP port — instantly. Cross-platform CLI for developers.

Readme

peekport

See what's using a port — instantly.

peekport is a small, cross-platform CLI that answers a question developers ask every day:

What's using port 3000?

npx peekport 3000
peekport

Port 3000
────────────────────────────────────────────

● IN USE

PID          18472
Process      node
Command      next dev
Directory    ~/projects/my-app
User         burak

Network
────────────────────────────────────────────

Address      127.0.0.1:3000
Protocol     TCP
State        LISTENING

Actions
────────────────────────────────────────────

Kill process:
  peekport 3000 --kill

Inspect process:
  peekport 3000 --details

If nothing is listening:

peekport

Port 3000
────────────────────────────────────────────

✓ AVAILABLE

Nothing is listening on port 3000.

Why it exists

lsof, ss, netstat, and PowerShell all answer this question — if you remember the flags, the output format, and the right tool for the OS you are on.

peekport is the same lookup with a consistent interface on Windows, macOS, and Linux.

Installation

npm install -g peekport

Or run it without installing:

npx peekport 3000

Requires Node.js 18 or newer.

Quick start

peekport 3000
peekport 3000 --details
peekport 3000 --json
peekport 3000 --kill

Multiple ports

peekport 3000 5173 8080
PORT     STATUS       PROCESS    PID
────────────────────────────────────────
3000     IN USE       node       18472
5173     IN USE       vite       21842
8080     AVAILABLE    —          —

Port ranges

peekport 3000-3010

Ranges are expanded locally. The OS is queried once, not once per port.

--kill

peekport 3000 --kill

peekport never kills a process unless you ask it to. Before terminating, it shows the PID, process name, and command line and asks:

Continue? [y/N]

For scripts:

peekport 3000 --kill --yes

Graceful termination is attempted first. If the process does not exit:

peekport 3000 --kill --force

Force termination can cause data loss. Only the exact PID discovered from the port lookup is targeted.

--details

peekport 3000 --details

Shows expanded process and socket information when the operating system exposes it: executable, command line, working directory, user, local/remote addresses, and TCP state.

Fields that are not available are shown as Unknown or omitted.

--json

peekport 3000 --json

Machine-readable JSON with no colors and no ANSI escape codes.

{
  "port": 3000,
  "protocol": "tcp",
  "status": "listening",
  "processes": [
    {
      "pid": 18472,
      "name": "node",
      "command": "next dev",
      "workingDirectory": "/projects/app"
    }
  ]
}

Multiple ports produce a JSON array.

--check and --ci

peekport 3000 --check
peekport 3000 --ci

--check prints a one-line availability result. --ci prints a script-friendly report and ends with PASS or FAIL.

Both exit with a non-zero status when the port is occupied, so they work in shell scripts and CI jobs.

peekport 3000 --check && npm start

--tree

peekport 3000 --tree

When parent process information is available:

node (18472)
└─ npm (18451)
   └─ shell (18442)

Relationships are never invented. If the parent chain cannot be read, that part is omitted.

Cross-platform behavior

| Platform | Lookup | Process details | | --- | --- | --- | | Linux | ss, then lsof, then netstat | /proc | | macOS | lsof, then netstat | ps / lsof | | Windows | netstat -ano, then Get-NetTCPConnection | Get-CimInstance / tasklist |

Platform-specific commands are isolated behind a single inspector abstraction. Missing optional tools degrade the amount of detail — they do not crash the lookup.

IPv4 and IPv6 listeners are both reported (127.0.0.1, 0.0.0.0, ::1, ::).

Permissions

Some operating systems hide process ownership for sockets you do not own. peekport still reports that the port is in use and explains when details are unavailable.

It does not tell you to re-run the entire tool as administrator or root unless that is actually required.

Security

peekport is local-only. It does not send system information, process information, or telemetry anywhere.

  • No network requests
  • No file modifications
  • No automatic process termination
  • Process names, paths, and command lines are treated as untrusted strings and are never executed

See SECURITY.md.

Development

npm install
npm run typecheck
npm run lint
npm test
npm run build

Testing

Unit tests parse representative ss, lsof, and netstat fixtures from Linux, macOS, and Windows so the suite is not tied to one developer machine.

Live tests bind a temporary TCP server (server.listen(0)) and verify that peekport detects it. Kill tests spawn a dedicated child process and terminate only that PID.

Contributing

See CONTRIBUTING.md.

License

MIT