Skip to content
This repository has been archived by the owner on Mar 7, 2019. It is now read-only.

knight42/node-is-listening

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is-listening Build Status

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

About

Test whether socket is open and listening synchronously

Resources

License

Stars

Watchers

Forks

Packages

No packages published