nodejs-tcp-ping
TCP Ping is a Node.JS based TCP ping utility written in Typescript
Getting Started
If you are using yarn (RECOMMENDED!)
yarn add nodejs-tcp-ping
If you are using npm
npm install nodejs-tcp-ping --save
Using with JavaScript
const nodejsTcpPing = require('nodejsTcpPing');
nodejsTcpPing.tcpPing().then(results => {
}).catch(reason => {
});
nodejsTcpPing.tcpPing({
attempts: 5,
host: 'localhost',
port: 80,
timeout: 5000
}).then(results => {
}).catch(reason => {
});
Using with TypeScript
import { tcpPing, IPingData } from 'nodejsTcpPing';
tcpPing().then((result: IPingData[]) => {
}).catch((reason: any) => {
});
tcpPing({
attempts: 5,
host: 'localhost',
port: 80,
timeout: 5000
}).then((result: IPingData[]) => {
}).catch((reason: any) => {
});
Testing with yarn
1. Install all the dependencies with yarn
yarn
2. Build the lib with yarn
yarn build
3. Run all the tests with yarn
yarn test
Testing with npm
1. Install all the dependencies with npm
npm install
2. Build the lib with npm
npm run build
3. Run all the tests with npm
npm test