2.1.7 • Published 12 months ago

@3kles/3kles-socketio v2.1.7

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

@3kles/3kles-socketio

This package contains class to create sockets

Models

IGenericMessage is a model to represent the message exchanged

  • type?: string: Type of the message
  • to?: string: Specify to who you want to send the message
  • room?: string: Specific room where to send to the message
  • content: any: Content of the message

Interfaces

IGenericSocket is a generic socket interface

  • start(): Promise\: To initialize the connections
  • getUsers(): Map<string, any>: To get the users connected
  • addListener(listener?: { event: string, listener: (...args: any[]) => void }): void: To add a listener

Install

npm

npm install @3kles/3kles-socketio --save

How to use

How to create a socket

const broker = await MessageBroker.getInstance();

const app = new GenericApp();
const server = app.startApp();
const genericSocket = new GenericSocket(broker, server);
await genericSocket.start();

Check the documentation here.

2.1.6

12 months ago

2.1.5

12 months ago

2.1.7

12 months ago

2.1.2

1 year ago

2.1.1

1 year ago

2.1.4

1 year ago

2.1.3

1 year ago

2.1.0

1 year ago

2.0.0

1 year ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago