1.0.3 • Published 12 months ago

is-ready-tcp v1.0.3

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
12 months ago

is-ready-tcp

is-ready-tcp allows you to easy await and check any tcp service connection

Installation

npm i is-ready-tcp

Usage

const isReadyTcp = require( 'is-ready-tcp' );
( async () => {
    try {
        await isReadyTcp( 3000 );

        // Success
        // You can connect to your service

    } catch ( error ) {
        // Connection timeout reached
    }
} )();

Parameters

isReadyTcp( port: Integer [, host: String = 'localhost' [, timeOutSeconds: Number = 30 [, intervalAttemptsSeconds: Number = 1 ]]] )