PageRenderTime 43ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/client/nodejs-component/node_modules/protobufjs/examples/protoify/README.md

https://github.com/sapo/sapo-broker
Markdown | 28 lines | 21 code | 7 blank | 0 comment | 0 complexity | 87bc1525724acf8fa5d8eea239a582cd MD5 | raw file
Possible License(s): GPL-3.0, BSD-3-Clause, CC-BY-SA-3.0, Apache-2.0
  1. ProtoBuf.js protoify example
  2. ============================
  3. This example shows the general usage of ProtoBuf.js by converting JSON structures to protocol buffers and vice versa
  4. using a definition describing JSON itself. While this works as an example, it does not provide any real world benefits
  5. (well, this is if you are not building a protobuf-backed database for JSON data, using inter-field substitution to
  6. minimize redundancy - nevermind, forget that).
  7. Instructions
  8. ------------
  9. 1. Set up dependencies: `npm install`
  10. 2. Run: `npm test`
  11. 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':
  12. * **[index.js](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/index.js)**
  13. contains the sample's source code
  14. * **[json.proto](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/json.proto)**
  15. contains the protobuf definition used
  16. * **[json.json](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/json.json)**
  17. contains the protobuf definition converted through `proto2js json.proto > json.json`
  18. * **[json.js](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/json.js)**
  19. contains the protobuf definition converted through `proto2js json.proto -commonjs=js > json.js`
  20. * **[test.js](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/test.js)**
  21. contains our simple test suite