New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

kp-node

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kp-node

A CLI tool to quickly identify and terminate processes running on specified ports

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

Port Killer CLI (kp)

A powerful Node.js CLI tool that quickly identifies and terminates processes running on specified ports. Perfect for developers and DevOps engineers who need to manage port conflicts efficiently.

Features

  • Kill processes on specific ports with a simple command
  • Support for multiple ports and port ranges
  • Interactive mode with process information
  • Watch mode for automatic port monitoring
  • Save and load port combinations as presets
  • Cross-platform support (Windows, macOS, Linux)
  • JSON output for automation
  • Colorful and informative output

Installation

npm install -g kport

Usage

Basic Commands

# Kill a process on a specific port
kp 3000

# Kill processes on multiple ports
kp 3000,3001,3002

# Kill processes in a port range
kp 3000-3010

# Force kill without confirmation
kp 3000 -f

# Show process information before killing
kp 3000 -i

# List all active ports before/after operation
kp 3000 -l

# Output in JSON format
kp 3000 -j

# Dry run (show what would be killed)
kp 3000 -d

Watch Mode

Monitor a port and automatically kill processes that start using it:

# Watch port 3000
kp watch 3000

# Watch with custom check interval (in milliseconds)
kp watch 3000 -i 5000

Port Scanning

Scan for all active ports on your system:

# List all active ports
kp scan

# Output scan results in JSON format
kp scan -j

Presets

Save and load port combinations:

# Save a preset
kp save dev 3000,3001,3002

# Load and execute a preset
kp load dev

Options

  • -f, --force: Force kill without confirmation
  • -l, --list: List all running ports before/after operation
  • -i, --info: Show detailed process information before killing
  • -j, --json: Output in JSON format
  • -v, --verbose: Show detailed logs during execution
  • -q, --quiet: Suppress all output except errors
  • -d, --dry-run: Show what would be killed without actually killing
  • -c, --config: Use custom configuration file

Configuration

The tool can be configured through:

  • Global config file (automatically created)
  • Project-level config (.kprc or in package.json)
  • Environment variables (KP_DEFAULT_OPTIONS)

Security

  • Permission checks before killing system processes
  • Warning when attempting to kill critical system ports
  • Safeguards against privilege escalation

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Keywords

cli

FAQs

Package last updated on 19 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts