Skip to content
This repository has been archived by the owner on Aug 17, 2022. It is now read-only.
/ pbf-split Public archive

Splits a Node stream of protocol buffer messages

License

Notifications You must be signed in to change notification settings

mourner/pbf-split

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pbf-split

WARNING: this module is a mistake. Use the clearly superior length-prefixed-stream instead (only discovered after writing this one).

Build Status Coverage Status

A Node stream that splits a stream of multiple Protocol Buffer messages into individual messages.

How to use

The recommended way to stream protocol buffers is to encode them like this:

[message_length][message][message_length][message] ...

The pbf-split stream splits and reassembles an incoming stream so that it outputs individual message buffers which can then be decoded conveniently (e.g. using pbf) in a streaming way.

var pbfsplit = require('pbfsplit');

fs.createReadStream('data.pbf')
.pipe(pbfsplit())
.on('data', function (message) {
    // decode the message
});

About

Splits a Node stream of protocol buffer messages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published