Socket
Socket
Sign inDemoInstall

connection-tester

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    connection-tester

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


Version published
Weekly downloads
2K
decreased by-14.82%
Maintainers
1
Install size
19.4 kB
Created
Weekly downloads
 

Readme

Source

connection-tester

Build Status

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.

How to Use

Async version
const connectionTester = require('connection-tester');

connectionTester.test(
    'www.yahoo.com',  // host
    80,               // port
    1000,             // connection timeout
    (err, output) => {
        console.log(output);
    }
);

connectionTester.test(
    'api.paypal.com', // host
    443,              // port
    1000,             // connection timeout
    (err, output) => {
        console.log(output);
    }
);
Sync version
const connectionTester = require('connection-tester');

console.log(connectionTester.test('www.yahoo.com', 80, 1000));
console.log(connectionTester.test('api.paypal.com', 443, 1000));

Keywords

FAQs

Last updated on 16 Dec 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc