snappy-msgpack-stream
v4.0.0
Published
Streams of framed Snappy-compressed MessagePack messages
Downloads
6
Maintainers
Readme
snappy-msgpack-stream
Streams of framed Snappy-compressed MessagePack messages.
Usage
var snappyStream = require('snappy-msgpack-stream');
var encode = snappyStream.createEncodeStream();
var decode = snappyStream.createDecodeStream();
encode.pipe(decode);
decode.on('data', console.log);
encode.write('HELLO');
encode.write({object: true});
encode.write(true);
encode.write({foo: true, bar: 42, baz: null, pow: "wow"});
// encode.write(anyMessagePackSerializableObject);
Limitations
Please note that MessagePack does not support many JavaScript types, like e.g. Infinity
or NaN
. However, we use msgpack-lite, which implements a slightly extended MessagePack protocol, and allows encoding and decoding Infinity
and NaN
, as well as Buffer
instances.