Technology moves fast! ⚡ Don't get left behind.🚶 Subscribe to our mailing list to keep up with latest and greatest in open source projects! 🏆


Subscribe to our mailing list

protocol-buffers-stream

Streaming protocol buffers for Node.js

Subscribe to updates I use protocol-buffers-stream


Statistics on protocol-buffers-stream

Number of watchers on Github 35
Number of open issues 0
Average time to close an issue about 3 hours
Main language JavaScript
Average time to merge a PR about 19 hours
Open pull requests 0+
Closed pull requests 0+
Last commit over 3 years ago
Repo Created almost 5 years ago
Repo Last Updated over 1 year ago
Size 12 KB
Organization / Authormafintosh
Contributors2
Page Updated
Do you use protocol-buffers-stream? Leave a review!
View protocol-buffers-stream activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating protocol-buffers-stream for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

protocol-buffers-stream

Streaming protocol buffers for Node.js

npm install protocol-buffers-stream

build status

Usage

Assuming you have the following schema

message Test {
  required string hello = 1;
}

Run the following example

var protobufs = require('protocol-buffers-stream')
var fs = require('fs')

var schema = fs.readFileSync('schema.proto')
var createStream = protobufs(schema)

var stream = createStream()

// send a test message
// if your schema message was named example this method would be called example
stream.test({
  hello: 'world'
})

// receive a test message
stream.on('test', function(m) {
  console.log(m)
})

// just pipe to ourselves for testing
stream.pipe(stream)

Encoding

Each buffer is sent using the following encoding

----------------------------------------------
| frame length | message id | message buffer |
----------------------------------------------

The first message sent is a handshake message that contains the message ids of the following messages

If you know that your schema won't change you can pass {handshake:false} to createStream to disable handshaking

License

MIT

protocol-buffers-stream list of languages used
Other projects in JavaScript