Pure node.js Google Protocol Buffers implementation
Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages – Java, C++, or Python.
And now Google Protocol Buffers are available in node.js without compiling binary addons!
This module has been tested with node.js versions 0.8.26, 0.10.22 and 0.11.9.
Based on prtbfr.php by Gaetano Giunta.
Check out the Github repo for the source code.
You can install this module via npm:
$> npm install gpb
No specific libraries are needed because this is pure node.js module, not a binary addon.
var GPB = ;var proto =1: "field_string" GPBSTRING GPBREQUIRED2: "field_double" GPBDOUBLE GPBOPTIONAL3: "field_floats" GPBFLOAT GPBREPEATED;var data ="field_string": "Some string""field_double": 2e30"field_floats":112233;var expected_encoded_data_length = GPB;var encoded_data = expected_encoded_data_length;var actual_encoded_data_length = GPB;
To contribute any patches, simply fork this repository using GitHub and send a pull request to me. Thanks!
MIT license. See license text in file LICENSE.