is-ready-tcp
v1.0.3
Published
Simple check to tcp service
Downloads
8
Readme
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 ]]] )