Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

ctrl-web-socket-message

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ctrl-web-socket-message

The Message class for web socket data.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

ctrl-react-web-socket

Build Status Codacy Badge Codacy Badge

The Message class for web socket data.

Installation

Yarn is recommended for installation.

$ yarn add ctrl-web-socket-message

But you can still use npm:

$ npm install --save ctrl-web-socket-message

Usage

const Message = require('ctrl-web-socket-message')

const message = new Message({
  test: 'payload'
})

// Pseudo socket code
socket.emit('test event', message, callback)

Methods

Message constructor(Any payload)

Constructs a new message, automatically giving it a timestamp and id.

Message static Message.convert(Object rawMessage)

Converts a raw object into a Message. data, timestamp, and id fields are required.

License

Copyright (c) 2016 Martin Experiments LLC

MIT (https://www.opensource.org/licenses/MIT)

FAQs

Package last updated on 28 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts