![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
tcp-emitter-client
Advanced tools
TCP Emitter Client
is an EventEmitter that can connect with a TCP Emitter Server to interact with other connected clients.
npm install --save tcp-emitter-client
Options | Type | Default | Description |
---|---|---|---|
options.delimiter | string | '@@@' | Delimiter used to seperate payloads in a single TCP request. More info here. |
net.Socket object used to connect the TCP Emitter client
with the TCP Emitter server
.
Function used to connect the TCP Emitter client
with a TCP Emitter server
.
Alias to client.socket.connect.
Function used to disconnect the TCP Emitter client
from the TCP Emitter server
.
Alias to client.socket.end.
When a TCP Emitter client
is connected to a TCP Emitter server
, apart from functioning as a normal EventEmitter, it will need to interact with the TCP Emitter server
it is connected to through TCP requests. The following section describes when this client sends each type of request.
TCP Emitter client
connects with a TCP Emitter server
it will subscribe to all the events it has registered listeners.TCP Emitter client
is connected to a TCP Emitter server
and a first listener is added to an event.TCP Emitter client
is connected to a TCP Emitter server
and a last listener is removed from an event.TCP Emitter client
is connected to a TCP Emitter server
and an event is emitted.// Create a new TCP Emitter client.
const clientInst = require('tcp-emitter-client')()
// Function to serve as a listener for this example.
const listener = (name) => console.log(`Hello ${name}`)
// When adding a listener to an event before connecting to a TCP Emitter server,
// TCP Emitter client will function as a normal EventEmitter and thus refrain
// from sending a TCP Emitter subscribe request.
clientInst.on('new-user', listener)
// When connecting to a TCP Emitter server, TCP Emitter client will subscribe to
// all the events it currently has registered. By doing this its listeners will
// be invoked when a connected client emits the same events.
clientInst.connect(8080)
// When adding the first listener to an event in TCP Emitter client after
// connecting to a TCP Emitter server, TCP Emitter client will automatically
// send a TCP Emitter Subscribe request to the TCP Emitter server it is
// connected to. By doing this the listener & future listeners of the event will
// be invoked whenever a connected client emits the same event.
clientInst.on('remove-user', listener)
// When removing the last listener from a TCP Emitter client after connecting to
// a TCP Emitter server, TCP Emitter client will automatically send a TCP
// Emitter Unsubscribe request to the TCP Emitter server it is connected to.
clientInst.removeListener('remove-user', listener)
// When emitting an event after connecting the TCP Emitter client to a TCP
// Emitter server, TCP Emitter client will automatically send a TCP Emitter
// Broadcast request to the TCP Emitter server it is connected to. By doing this
// it will invoke the listeners of the event emitted of all the other connected
// clients.
clientInst.emit('new-user', [1, '2', true, { name: 'luca' }])
npm install
npm test
npm install
npm run docs
ISC
FAQs
Client for TCP Emitter Server
The npm package tcp-emitter-client receives a total of 1 weekly downloads. As such, tcp-emitter-client popularity was classified as not popular.
We found that tcp-emitter-client 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.