Simple, fast port killer with zero dependencies
npm install killit> Simple, fast port killer with zero dependencies
Kill processes running on specified ports. Works on macOS, Linux, and Windows.
- ✨ Zero dependencies - Only uses Node.js built-in modules
- 🚀 Fast & Simple - Clean TypeScript code
- 🔧 Cross-platform - Works on macOS, Linux, and Windows
- 📦 Tiny - Minimal footprint
- 🎯 Multiple ports - Kill multiple ports at once
- 🔌 TCP & UDP - Support for both protocols
``bash`
npm install -g killit
`bash`
npm install killit
`bash`
npx killit 3000
`bashKill single port
killit 3000
$3
-
-p, --port - Port number(s) to kill (comma-separated)
- -m, --method - Protocol: tcp or udp (default: tcp)
- -v, --verbose - Show detailed output
- -h, --help - Show help messageProgrammatic Usage
`typescript
import { killPort, killPorts } from 'killit';// Kill single port
await killPort(3000);
// Kill with options
await killPort(3000, { protocol: 'tcp', verbose: true });
// Kill multiple ports
await killPorts([3000, 8080, 5000]);
// Kill multiple ports with options
await killPorts([3000, 8080], { protocol: 'udp', verbose: true });
`API
$3
Kill process on a single port.
Parameters:
-
port (number | string) - Port number (1-65535)
- options (optional)
- protocol ('tcp' | 'udp') - Default: 'tcp'
- verbose (boolean) - Default: falseReturns: Promise
Throws: Error if port is invalid or no process found
$3
Kill processes on multiple ports.
Parameters:
-
ports (Array) - Array of port numbers
- options (optional) - Same as killPortReturns: Promise
Throws: Error if any port fails to kill
Development
`bash
Install dependencies
npm installBuild
npm run buildWatch mode
npm run dev
``Compared to other port-killing tools:
- Zero dependencies - No external packages needed
- Simpler code - Easy to understand and modify
- TypeScript - Full type safety
- Modern - Uses async/await, ES modules
- Tiny - Minimal package size
MIT