Skip to content

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

License

Notifications You must be signed in to change notification settings

dariachen/cross-port-killer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cross-port-killer

Build Status npm version npm downloads dependencies Commitizen friendly greenkeeper

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.

$ 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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 93.7%
  • JavaScript 6.3%