1.0.14 • Published 3 months ago
vin-socket.client v1.0.14
VIN-SOCKET.CLIENT
Is ES Module, a websocket client side connection that minified the functionalities and strategies of Websocket for easy implementation of websocket.
This module required to install its peer module vin-socket.server to server side in order to work correctly.
Installation
npm install vin-socket.client
Features
- easy to consume
- modern approach
- background digestion into binary data
Usage Examples
Listen to server
const { createServer } = require("http");
const { SocketClient } = require("vin-socket.client");
const wsClient = new SocketClient('ws://localhost:3000');
wsClient.on("res:message", (payload) => {
console.log(`Received payload from server`, payload)
})
NOTE: We recommend to put the instantiation in top level code
Emit to server
...
wsClient.emit("req:message", {
message: `Hello server!`
})
Contributing
Unfortunately we are not accepting any contributors yet this is under probitionary, but for your concerns and possible suggestions just email me at petatemarvin26@gmail.com
Changelog
We're using github release and based on semantic versioning