Awesome
pbf-split
WARNING: this module is a mistake. Use the clearly superior length-prefixed-stream instead (only discovered after writing this one).
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
});