Message

This class represents a WebSocket message.

Constructor

new Message(data)

The Message class encapsulates a WebSocket message.

Parameters:
NameTypeDescription
dataObject
Since
  • 3.4.0
License
  • AGPLv3
Throws:

value is not a object

Type
TypeError

Methods

getData() → {object}

Returns the raw message.

Returns the raw message.

Returns:
Type: 
object

toJSON() → {*}

Returns:
Type: 
*

(static) fromJSON(json) → {Message}

Parameters:
NameTypeDescription
jsonstring
Throws:

value is not a string

Type
TypeError
Returns:
Type: 
Message