2.1.7 • Published 10 months ago

@3kles/3kles-socketio v2.1.7

Weekly downloads
-
License
ISC
Repository
-
Last release
10 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

10 months ago

2.1.5

10 months ago

2.1.7

10 months ago

2.1.2

10 months ago

2.1.1

10 months ago

2.1.4

10 months ago

2.1.3

10 months ago

2.1.0

10 months ago

2.0.0

11 months ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.3

1 year ago

1.0.0

1 year ago