tcp-client is a minimal Node.js TCP client that provides a callback-based interface for sending requests and receiving responses. The current version 1.1.9 (last updated 2016) is stable but lacks active maintenance. It differs from full-featured TCP libraries (e.g., net module or generic-pool) by offering a simple wrapper with automatic logging of sent and received data, but lacks promises, TypeScript types, and modern JS features. Suitable only for simple synchronous-style TCP communication in legacy projects.
npm install tcp-clientNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
This example creates a TCP client, sends a buffer to the server, and handles the callback with error or response.
Use correct npm package name: npm install tcp-client
Set timeout as string: options.timeout = '5000'
Use response.toString() or explicitly handle Buffer.
Wrap in util.promisify or use a different library that supports promises.
Verify the server IP and port, increase timeout value, and ensure the server is reachable.
Use CommonJS require: const tcpClient = require('tcp-client').No dependency data recorded yet.