1.0.6 • Published 1 year ago

fantata-socket-set v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Fantata Socket Set

A simple websocket library with client and server components & message acknowledgment / resend. Still a work in progress, so may have bugs and this readme may not be comprehensive.

Installation

npm i fantata-socket-set

Usage

Import the library server side:

import SocketSet from 'fantata-socket-set';

Include the cient side script:

<script type="module" src="/browser/browser.mjs"></script>

Initialise the service:

SocketSet.init(server);

Add your node event listeners:

SocketSet.addListener('yourCode', data => {
  // do stuff here
});

Send messages client side:

window.addEventListener("socketSetLoaded", function(e) {
    
    const app = e.detail;

    app.wsSend({
        "type": "newGame"
    });

});
1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago