1.0.0 • Published 6 years ago

@ncodefactory/tcpipcli v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

tcpipcli

installation:

npm:

npm install @ncodefactory/tcpipcli --save

yarn:

yarn add @ncodefactory/tcpipcli

usage:

import tcpipcli from '@ncodefactory/tcpipcli';

const host = 'localhost';
const port = 5000;
const timeout = 3000; // milliseconds

const client = tcpipcli(host, port, timeout);

const requestData = [74, 32, 91];
const request = Buffer.from(requestData); // request must have the Buffer type https://nodejs.org/dist/latest-v10.x/docs/api/buffer.html

const response = await client(request);