ws-send
Send any types of data through WebSocket by ws.
Install
npm install ws-send
Usage
Server
wsServer.on'connection', httpServer.listen8000
Client
ws.on'open',
Available data types
The types below are currently supported.
string
number
boolean
null
undefined
symbol
bigint
NaN
Infinity
RegExp
Date
Array
Object
Set
Map
URL
URLSearchParams
Buffer
DataView
ArrayBuffer
Int8Array
Uint8Array
Uint8ClampedArray
Int16Array
Uint16Array
Int32Array
Uint32Array
Float32Array
Float64Array
BigInt64Array
BigUint64Array
Typings
For TypeScript, sendify()
accepts type arguments for sending & receiving data.
// sendify<SendingDataType, ReceivingDataType> // send() only accepts stringwss.send'test' wss.on'message',