msgpack5-stream

1.0.0 • Public • Published

msgpack5-stream

Given a regular duplex stream, this module will return a duplex stream optimised for sending and receiving msgpack5 messages.

Build status js-standard-style

Usage

var net = require('net')
var msgpack = require('msgpack5-stream')
 
var server = net.createServer(function (socket) {
  var dup = msgpack(socket)
 
  dup.on('data', function (obj) {
    console.log(obj) // { hello: 'world' }
  })
})
 
server.listen(3000, function () {
  var dup = msgpack5(net.connect(3000))
  dup.write({hello: 'world'})
})

License

MIT

Package Sidebar

Install

npm i msgpack5-stream

Weekly Downloads

8

Version

1.0.0

License

MIT

Last publish

Collaborators

  • watson