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

portcull

v1.0.0

Published

A fast, zero-dependency CLI to list and kill the processes holding your dev ports — never fight EADDRINUSE again.

Readme

portcull

npm version CI License: MIT Node Dependencies

List and kill the processes holding your dev ports — never fight EADDRINUSE again.

portcull is a fast, zero-dependency CLI for the daily "port already in use" annoyance. See what's listening, what it is, and how long it's been running — then free the port with one command.

Demo recorded with vhs — regenerate with vhs docs/demo.tape.

Contents

$ portcull ls

PORT   PID    LABEL        UPTIME  COMMAND
3000   8821   Next/React   2h14m   node next dev
5173   9930   Vite         18m     node vite
5432   612    Postgres     3d4h    postgres

3 listening ports · 3 known dev

$ portcull kill 3000
killed 8821 on 3000 (SIGTERM)  node next dev

Install

npm install -g portcull
# or run without installing
npx portcull ls

Requires Node.js >= 18 on macOS or Linux (uses lsof and ps, which ship with both).

Usage

portcull ls                  # list every listening TCP port (default command)
portcull ls --dev            # only known dev ports (Next, Vite, Postgres, …)
portcull ls -p 3000,5173     # only specific ports
portcull ls --json           # machine-readable output

portcull kill 3000           # kill whatever listens on 3000 (SIGTERM)
portcull kill 3000 5173      # kill several at once
portcull kill 3000 --force   # SIGKILL instead of SIGTERM
portcull kill 3000 --dry-run # show what would die, kill nothing

portcull profile add web 3000 5173   # save a named group of ports
portcull profile ls                  # list profiles
portcull kill -P web                 # kill every port in "web"
portcull profile rm web              # remove a profile

free and k are aliases for kill.

Profiles

Profiles let you tear down a whole stack at once. They're stored as JSON at ~/.config/portcull/config.json (override with the PORTCULL_CONFIG env var).

portcull profile add stack 3000 5173 5432 6379
portcull kill -P stack

How it works

portcull shells out to lsof -nP -iTCP -sTCP:LISTEN to enumerate listening sockets, enriches each with the owning process's command and uptime via ps, and signals processes with Node's process.kill. Kill defaults to SIGTERM (graceful); --force uses SIGKILL. There's no magic and no daemon — every action maps to something you could type yourself.

Some runtimes report a command line with no project-identifying info at all (Next.js renames its dev worker to the generic next-server (vX.Y.Z) regardless of which project spawned it). For a small allowlist of these opaque commands, portcull resolves the owning project by looking up the process's working directory (one extra batched lsof -d cwd call, not one per port) and reading name from its package.json, falling back to the directory name — e.g. next-server (v16.2.9) · agent-hq. If the lookup fails for any reason, the generic command is shown unchanged.

Library use

The internals are exported for programmatic use:

import { getListeningPorts, planKill, killTargets } from 'portcull';

const entries = getListeningPorts();
const targets = planKill(entries, [3000]);
killTargets(targets); // SIGTERM

Development

npm install
npm test          # run the vitest suite
npm run coverage  # with coverage

Notes & caveats

  • macOS / Linux only — Windows is not supported (no lsof).
  • kill acts immediately; use --dry-run first if you're unsure what's on a port.
  • Killing a port owned by a system service may require elevated privileges; a failed kill is reported and exits non-zero.

Contributing

Contributions are welcome! Please open an issue first to discuss what you'd like to change.

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -m 'feat: describe change')
  4. Push and open a pull request

Please make sure npm test passes before submitting a PR.

Code of Conduct

This project follows the Contributor Covenant v2.1. By participating you agree to uphold a welcoming, harassment-free environment.

License

Distributed under the MIT License. See LICENSE for details.

MIT © David Chong