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

zport

v1.0.0

Published

Kill processes running on specified ports. Fast, zero-dependency, cross-platform.

Readme

zport

Kill processes running on specified ports. Fast, zero-dependency, cross-platform.

Why zport?

Existing tools like kill-port shell out to lsof -i -P and parse the entire connection table with a loose regex — which means they miss processes, false-match adjacent port numbers, and fail silently on Linux when lsof isn't installed.

zport fixes all of that:

  • Linux — uses fuser (fast, exact match) → falls back to ss → then lsof
  • macOS — uses lsof -ti with exact port + LISTEN filter
  • Windows — uses netstat -ano with exact port + LISTENING match → taskkill
  • Zero dependencies — just Node.js child_process.execFile, no shell spawning
  • TypeScript — fully typed, ships with declarations

Install

npm i -g zport

Or run directly without installing:

npx zport 3000
bunx zport 3000

Usage

CLI

# Kill a single port
zport 3000

# Kill multiple ports
zport 3000 3001 8080

# Comma-separated
zport 3000,3001,8080

# UDP instead of TCP
zport 5353 --method udp
zport 5353 -m udp

Output:

✔ :3000 — killed pid 12345
✔ :3001 — killed pids 12346, 12347
✘ :8080 — No process on this port

Programmatic

import { kill } from "zport";

const result = await kill(3000);
// { port: 3000, pids: [12345], killed: true }

const result2 = await kill(9999);
// { port: 9999, pids: [], killed: false, error: "No process on this port" }

kill(port, method?)

| Param | Type | Default | Description | | -------- | ---------------- | ------- | ---------------------- | | port | number | — | Port number (1–65535) | | method | "tcp" \| "udp" | "tcp" | Protocol to match |

Returns Promise<KillResult>:

interface KillResult {
  port: number;
  pids: number[];
  killed: boolean;
  error?: string;
}

How it works

| OS | Find PIDs | Kill | | ------- | ---------------------------------------------- | -------------- | | Linux | fuser {port}/tcpss -tlnplsof -ti | SIGKILL | | macOS | lsof -iTCP:{port} -t -sTCP:LISTEN | SIGKILL | | Windows | netstat -ano (exact port + LISTENING) | taskkill /F |

On Linux, fuser is tried first because it directly queries the kernel's socket table — no parsing, no regex, no false matches. If fuser isn't available (minimal containers), it falls back to ss, then lsof.

License

MIT