$ npm install length-prefixed-message
#length-prefixed-message
Reads and writes binary length prefixed messages.
##Install
npm install length-prefixed-message
##Example
var lpm = require('length-prefixed-message');
lpm.read(someStream, function(msgBuffer) {
console.log(msgBuffer.toString());
});
lpm.write(someOtherStream, new Buffer('hello world'));
// or you can just pass a string if you want.
lpm.write(someOtherStream, 'hello world');
© 2010 - cnpmjs.org x YWFE | Home | YWFE