Newton's Programmatic Measurements
Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

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

Install

npm i length-prefixed-message

DownloadsWeekly Downloads

1,138

Version

3.0.4

License

MIT

Unpacked Size

9.32 kB

Total Files

8

Last publish

Collaborators

  • avatar