Message pack encoder to encoder and decode packages

Usage no npm install needed!

<script type="module">
  import adonisjsMsgpackEncoder from 'https://cdn.skypack.dev/@adonisjs/msgpack-encoder';


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


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


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