Parser and encoder for TextFormat protobuf messages. Based on the C++ and Java TextFormat code in the Google implementation (https://github.com/google/protobuf). Uses ProtoBuf.js (https://github.com/dcodeIO/ProtoBuf.js) to validate and structure parsed messages.
Getting Started
Install from npm:
$ npm install protobuf-textformat
Parse text into ProtoBuf.js message objects:
var ProtoBuf = TextFormat = ; /* Load a protobuf schema. */var builder = ProtoBuf; /* Read a protobuf text format file that is valid under the schema. */var input = ; /* Parse the schema into a ProtoBuf.js messsage object. */var result = TextFormat; if resultstatus console; else console;