jsproto

v0.1.3
A a protobuf.js adapter for google-protobuf
protobuf protocol-buffers serialization typescript

jsproto

A wrapper for protobuf.js to be able to use their much faster parsers with google's officially supported javascript protobuf library.

Usage:

Serialization:

const proto = new RequestMessageP();
const serialized = jsproto.serialize(proto.constructor, proto, jspb); // Returns type Buffer in node.js, otherwise Uint8Array, like protobuf.js

Deserialization:

const data = new Buffer(...)
const deserialized = jsproto.deserialize(ResponseMessageP, data, jspb); // returns an instance of ResponseMessageP
npm i jsproto

Metadata

  • MIT
  • Whatever
  • James Sigurdarson
  • released 5/5/2021

Downloads

Maintainers