Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Failed to load latest commit information.
.gitignore
index.js Fixes #8
package.json
readme.markdown badge
test.js

readme.markdown

MsgPackStream

Streams of framed msgpack messages.

testling badge

WARNING

this module is not recommended parsing msgpack in js is much slower than spliting json into lines and parsing with JSON.parse, which is heavily optimised in all good js implementations.

instead use: es.parse and es.stringify

If you really want to use msgpack you should fix this issue: pgreiss/node-msgpack#16

usage

var mps = require('msgpack-stream')

var encode = mps.createEncodeStream()
var decode = mps.createDecodeStream()

encode.pipe(decode)

decode.on('data', console.log)

encode.write('HELLO')
encode.write({object: true})
encode.write(true)
encode.write(AnyValidJsObject) //!

remarks

this is mostly pulled out of smith and slightly refactored to fit a stream.

lies

Actually, msgpack does not support much loved js objects such as Infinity, or Nan.

On the other hand, msgpack-stream uses creationix/msgpack-js which implements a slightly extended protocol, so you can pack Buffer and undefined

Something went wrong with that request. Please try again.