killport

a nodejs module to kill any processes base on its port

Usage no npm install needed!

<script type="module">
  import killport from 'https://cdn.skypack.dev/killport';
</script>

README

killport

a nodejs module to kill any process given their port

Usage

For example, you want to kill the process listening on port 8080:


var killport = require('killport');

killport(8080)
// if success
.then(function(out){
  console.log(out);
})
// if failed
.catch(function(err){
  console.log(err);
});

Support

Only works on OS with lsof command.

License

MIT