Simple protocol buffers example written in JavaScript.
- Node.js and npm
- protoc
npm install
First you have to generate the JavaScript classes from the .proto
file:
protoc \
--proto_path=protocol_buffers/definitions \
--js_out=import_style=commonjs,binary:protocol_buffers/messages \
protocol_buffers/definitions/person.proto
Now you can use the generated getters, setters and methods for the serialization.
Run index.js
for the example:
node index.js
Run JSHint checks:
docker-compose run js-tools jshint index.js
Run JSCS checks:
docker-compose run js-tools jscs index.js
This project is licensed under the terms of the MIT License (MIT).