Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@cio/duplex-emitter
Advanced tools
Use two way event system for client/server communication.
Uses module duplex-emitter.
npm install @cio/duplex-emitter --save
Uses duplex-emitter
to setup a two-way remote event communication.
Enable it with the duplexEmitter:true
options property and it will produce a socket.duplexEmitter
sub-property and emit a 'duplex-emitter' event.
// get the `cio` module's builder function and build one
var buildCio = require('cio')
, cio = buildCio();
// provide the module name to load it for the specific type of socket
cio.onClient('@cio/duplex-emitter');
cio.onServerClient('@cio/duplex-emitter');
// OR: provide the function
var fn = require('@cio/duplex-emitter');
cio.onClient(fn);
cio.onServerClient(fn);
// tell this listener to do its thing for this client
var options = { duplexEmitter:true }
, client = cio.client(options)
, server = cio.server(options);
// the result is sockets connect (client and server client) it will do:
// socket.duplexEmitter = DuplexEmitter(socket);
// socket.emit('duplex-emitter', socket.duplexEmitter, socket);
// so, you can do this for both `client` and `server`
client.on('duplex-emitter', function(emitter, socket) {
emitter.on('some-event', someListener);
// and more...
});
// NOTE: it emits 'emitter' in `nextTick()` so you have a chance to add
// a listener for that event before it is emitted.
// if you specify key/cert, and optionally `ca`, values
// then it'll use `tls.connect()` instead for secure communication.
FAQs
Configure connection with duplex-emitter
The npm package @cio/duplex-emitter receives a total of 0 weekly downloads. As such, @cio/duplex-emitter popularity was classified as not popular.
We found that @cio/duplex-emitter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
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.