Skip to content

KlausTrainer/snappy-msgpack-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snappy-msgpack-stream

Build Status JavaScript Style Guide semantic-release

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.