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

cross-port-killer

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cross-port-killer

Kill the process running on a given TCP port on Windows, Linux and Mac

  • 1.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15K
decreased by-3.34%
Maintainers
1
Weekly downloads
 
Created
Source

cross-port-killer

npm version npm downloads dependencies

Kill the process running on a given TCP port on Windows, Linux and Mac

Install

$ npm install cross-port-killer -D

Usage

import { kill, killer } from 'cross-port-killer';

kill(9090).then(pids => {
  console.log(pids)
})

// you could also kill pids manually if you know them... this would save you bringing up another lib, you are welcome.

killer.killByPid(12345).then(() => console.log('done'))
killer.killByPids([12345, 54321]).then(() => console.log('done'))

This lib also comes with a CLI.

To kill any process occupying the port 9090 you can run:

$ npx cross-port-killer 9090

or

$ npm install cross-port-killer -g
$ kill-port 9090

Dependencies

On Linux/Mac this library depends on lsof in case you don't have it installed (perhaps you are using docker?) run:

$ apt-get install lsof

On Mac, It comes with the OS by default so nothing to worries.

License

MIT © Rafael Milewski

Keywords

FAQs

Package last updated on 13 Jan 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