npm.io
0.1.2 • Published 11 years ago

is-tcp-on

Licence
MIT
Version
0.1.2
Deps
2
Vulns
0
Weekly
0

is-tcp-on

check whether a tcp server could be connected

installation

npm i is-tcp-on

usage

var isTcpOn = require('is-tcp-on');
isTcpOn({
    port: 80,
    host: '127.0.0.1',
    timeout: 1000 // optional, default is 1000ms
})
.then(function () {
    // tcp server exists
}, function () {
    // can not connect to this tcp server
});

Keywords