port-killa
v1.0.0
Published
Kill any process running on a given port. Cross-platform (Linux, macOS, Windows).
Maintainers
Readme
port-killa
Kill any process occupying a given port. Cross-platform. Zero dependencies.
Stop fighting EADDRINUSE. Just kill it.
npx port-killa 3000Features
- 🔍 Auto-detects your OS — Linux, macOS, and Windows
- ⚡ Zero dependencies — pure Node.js built-ins
- 🛡️ Safe by default — confirmation prompt before killing
- 💀 Force mode —
--forcefor stubborn processes (SIGKILL / taskkill /F) - 👀 Dry-run mode — see what would be killed without doing it
- 📦 npx-ready — no global install needed
Usage
# Kill whatever is on port 3000
npx port-killa 3000
# Force-kill (SIGKILL on Unix, /F on Windows)
npx port-killa 8080 --force
# See what's running without killing it
npx port-killa 5173 --dry-run
# Skip the confirmation prompt
npx port-killa 4000 --yesOptions
| Flag | Alias | Description |
| ----------------- | ----- | ------------------------------------------- |
| --force | -f | Force-kill (SIGKILL / taskkill /F) |
| --dry-run | -dr | Show process info without killing |
| --yes | -y | Skip confirmation prompt |
| --help | -h | Show help |
| --version | -v | Show version |
How It Works
| Platform | Detection | Kill |
| -------- | ------------------ | ------------------- |
| Linux | lsof → ss | kill -15 / -9 |
| macOS | lsof | kill -15 / -9 |
| Windows | netstat -ano | taskkill |
On Linux, lsof is tried first. If it's not available (e.g. minimal containers), ss is used as a fallback.
Requirements
- Node.js ≥ 16
License
MIT
