Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@codetheweb/recon
Advanced tools
Keep your network connections alive in node.js no matter what.
Recon looks like a regular tcp connection but it listens for disconnect events
and tries to re-establish the connection behind the scenes. While the connection
is down, write()
returns false
and the data gets buffered. When the
connection comes back up, recon emits a drain
event.
var recon = require('recon');
var conn = recon(ip, port);
conn.on('data', function (buf) {
var msg = buf.toString().trim()
console.log(msg);
});
Create a connection. The arguments can be specified in kwargs
or wherever in
arguments list and are optional except port.
retry
— Millisecond interval between reconnection retries.retryErrors
— An array of errors that will cause a reconnect. Default ['ECONNREFUSED']
.Like stream.write
, but buffers data while the module is reconnecting.
Terminate the connection (and don't reconnect).
Just like stream.
Emitted only the first time the connection is established.
Emitted each time the module establishes a connection after the first time.
Just like stream, unless err.code
is in the retryErrors
array, in which case the
error gets eaten and recon reconnects behind the scenes.
FAQs
Keep a network connection alive by reconnecting repeatedly
The npm package @codetheweb/recon receives a total of 0 weekly downloads. As such, @codetheweb/recon popularity was classified as not popular.
We found that @codetheweb/recon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.