connection-tester

test if the connection can be established with the given host and port

connection-tester

Test to check if the connection can be established or host/port reachable for a given host and port. Useful for testing all the connection in your node application at server startup.

var connectionTester = require('connection-tester');
 
connectionTester.test('www.yahoo.com', 80, function (erroutput) {
    console.log(output);
});
connectionTester.test('api.paypal.com', 443, function (erroutput) {
    console.log(output);
});
var connectionTester = require('connection-tester');
 
console.log(connectionTester.test('www.yahoo.com', 80));
console.log(connectionTester.test('api.paypal.com', 443));