Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kill-port

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kill-port

Kill process running on given port

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
204K
increased by0.59%
Maintainers
1
Weekly downloads
 
Created

What is kill-port?

The kill-port npm package is a utility that allows you to kill processes running on specific ports. This can be particularly useful for developers who need to free up ports that are being used by other applications or processes.

What are kill-port's main functionalities?

Kill a specific port

This feature allows you to kill a process running on a specific port. In this example, the process running on port 3000 is terminated.

const kill = require('kill-port');

kill(3000)
  .then(() => {
    console.log('Port 3000 killed');
  })
  .catch((err) => {
    console.error('Error killing port 3000:', err);
  });

Kill a port with a specific protocol

This feature allows you to specify the protocol (TCP or UDP) when killing a port. In this example, the TCP process running on port 3000 is terminated.

const kill = require('kill-port');

kill(3000, 'tcp')
  .then(() => {
    console.log('TCP process on port 3000 killed');
  })
  .catch((err) => {
    console.error('Error killing TCP process on port 3000:', err);
  });

Kill multiple ports

This feature allows you to kill multiple ports simultaneously. In this example, the processes running on ports 3000 and 4000 are terminated.

const kill = require('kill-port');

Promise.all([kill(3000), kill(4000)])
  .then(() => {
    console.log('Ports 3000 and 4000 killed');
  })
  .catch((err) => {
    console.error('Error killing ports:', err);
  });

Other packages similar to kill-port

Keywords

FAQs

Package last updated on 21 Jun 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc