length-prefixed-message

3.0.4 • Public • Published

length-prefixed-message

build status

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');

Readme

Keywords

Package Sidebar

Install

npm i length-prefixed-message

Weekly Downloads

184

Version

3.0.4

License

MIT

Unpacked Size

9.32 kB

Total Files

8

Last publish

Collaborators

  • sorribas