watson / msgpack5-stream

A duplex stream wrapper for msgpack5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 = msgpack(net.connect(3000))
  dup.write({hello: 'world'})
})

License

MIT

About

A duplex stream wrapper for msgpack5

License:MIT License


Languages

Language:JavaScript 100.0%