No nonsense protocol buffers schema parser written in Javascript
npm install protocol-buffers-schema
Usage
First save the following file as example.proto
syntax = "proto2";message Point { required int32 x = 1; required int32 y=2; optional string label = 3;}message Line { required Point start = 1; required Point end = 2; optional string label = 3;}
The run the following example
var fs = require('fs')var schema = require('protocol-buffers-schema')// pass a buffer or string to schema.parsevar sch = schema.parse(fs.readFileSync('example.proto'))// will print out the schema as a javascript objectconsole.log(sch)
Running the above example will print something like