is-port-free

A simple node module to check if a TCP port is free on the local machine.

Usage no npm install needed!

<script type="module">
  import isPortFree from 'https://cdn.skypack.dev/is-port-free';
</script>

README

is-port-free

Shippable branch npm Linked In Twitter Follow

A simple node module to check if a TCP port is free on the local machine. See also is-port-busy

Installation

$ npm install --save is-port-free

Example

var isPortFree = require('is-port-free');

isPortFree(8080).then(function(){
    console.log('yes');
})
.catch(function(){
    console.log('no');
});

Running tests

Install dev dependencies and run tests:

$ npm install -d && npm test

License

Licensed under ISC License © John Doherty