msgpack5-stream
v1.0.0
Published
A duplex stream wrapper for msgpack5
Downloads
42
Maintainers
Readme
msgpack5-stream
Given a regular duplex stream, this module will return a duplex stream optimised for sending and receiving msgpack5 messages.
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