Skip to content

nyrobert/js-protobuf-example

Repository files navigation

JavaScript protocol buffers example

Simple protocol buffers example written in JavaScript.

Requirements

  • Node.js and npm
  • protoc

Installation

  npm install

Usage

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

Testing

Run JSHint checks:

  docker-compose run js-tools jshint index.js

Run JSCS checks:

  docker-compose run js-tools jscs index.js

License

This project is licensed under the terms of the MIT License (MIT).

About

Simple protocol buffers example written in JavaScript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published