@adonisjs/msgpack-encoder

1.0.4 • Public • Published

Message pack encoder

The msgpack encoder for Adonis websockets. This library can be used by browsers and Node.js both.

Nodejs or webpack

npm i --save @adonisjs/msgpack-encoder

CDN

<script src="https://unpkg.com/@adonisjs/msgpack-encoder"></script>
<script>
  const msgPack = new adonis.MsgPack()
</script>
const MsgPack = require('@adonisjs/msgpack-encoder')
const msgPack = new MsgPack()

Usage

The encoder is be used as follows.

const msgPack = new MsgPack()
msgPack.encode({ username: 'virk' }, (error, payload) => {
  // send payload
})

msgPack.decode(encodePayload, (error, packet) => {
  // websocket packet
})

Package Sidebar

Install

npm i @adonisjs/msgpack-encoder

Weekly Downloads

92

Version

1.0.4

License

MIT

Unpacked Size

207 kB

Total Files

6

Last publish

Collaborators

  • julien-r44
  • romainlanz
  • virk