Nibbling Perfect Macaroni
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    connection-testerpublic

    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));

    install

    npm i connection-tester

    Downloadsweekly downloads

    5,429

    version

    0.2.0

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar