capnp-stream
A Node.js readable stream for Cap’n Proto encoded binary input.
Install
With NPM:
npm install --save capnp-stream
Note: capnp binaries need to be available in your system. Check out the official
Cap’n Proto install guide for OS-specific instructions.
Usage
capnp-stream
allows to consume Cap’n Proto files as a readable stream, that emits
objects.
Example usage:
const capnp = require('capnp')
const CapnpStream = require('capnp-stream')
const schema = capnp.import(join(__dirname, 'person.capnp'))
const capnpStream = new CapnpStream(schema.Person)
capnpStream.on('data', (d) => {
console.log(JSON.stringify(d, null, 2))
})
Contributing
Everyone is very welcome to contribute to this project.
You can contribute just by submitting bugs or suggesting improvements by
opening an issue on GitHub.
License
Licensed under MIT License. © Luciano Mammino.