is-ready-tcp
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i is-ready-tcp

Weekly Downloads

1

Version

1.0.3

License

GPL-3.0-or-later

Unpacked Size

37.9 kB

Total Files

5

Last publish

Collaborators

  • angy91m