1 ProtoBuf.js protoify example
\r
2 ============================
\r
3 This example shows the general usage of ProtoBuf.js by converting JSON structures to protocol buffers and vice versa
\r
4 using a definition describing JSON itself. While this works as an example, it does not provide any real world benefits
\r
5 (well, this is if you are not building a protobuf-backed database for JSON data, using inter-field substitution to
\r
6 minimize redundancy - nevermind, forget that).
\r
10 1. Set up dependencies: `npm install`
\r
13 Now you know no more and no less than that it works and you might want to inspect the following files to get the 'how':
\r
15 * **[index.js](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/index.js)**
\r
16 contains the sample's source code
\r
18 * **[json.proto](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/json.proto)**
\r
19 contains the protobuf definition used
\r
21 * **[json.json](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/json.json)**
\r
22 contains the protobuf definition converted through `proto2js json.proto > json.json`
\r
24 * **[json.js](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/json.js)**
\r
25 contains the protobuf definition converted through `proto2js json.proto -commonjs=js > json.js`
\r
27 * **[test.js](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/test.js)**
\r
28 contains our simple test suite
\r