is-listening
v1.0.2
Published
Test whether socket is open and listening synchronously
Downloads
4
Readme
is-listening
Returns true
if socket is open and listening.
Install
yarn add is-listening
npm install -S is-listening
Usage
const isListening = require('is-listening')
// isListening(port[, host])
// isListening(socketPath)
// Assume Nginx is running
assert(isListening(80, 'localhost') === true)
assert(isListening(79) === false)
// Assume Docker is running
assert(isListening('/var/run/docker.sock') === true)
Running tests
npm install
npm run build
npm test
npm run lint