If you use Node.js, itβs easier to just use the NPM version of the protobuf library, it will build it for you if you have a C ++ compiler on your computer:
> npm install protobuf
To create your own message and analyze the existing message:
var Schema = require('protobuf').Schema; var readFile = require('fs').readFileSync; var schema = new Schema(readFile(__dirname+'/Voos-message.desc')); var VooMsg = schema['net.violet.voos.message.VoosMsg'];
The protobuf library works very well and is easy to use. But if you want a clean version of JS, look at: ProtoBufJS
source share