decode-protobuf
v0.0.4
Published
decodes protobuf messages from the wire into JSON objects
Readme
decode-protobuf
A javascript library for decoding protobuf messages without requiring the .proto file definitions. You get one big javascipt object to sort through.
It will not:
- create
.protofile definitions - work as a
protobufclient in any manner
This is a "port" (the code is 99% the same) of the pertinent code from the protobuf-decoder React project packaged for re-use.
Installation
npm install decode-protobufUsage
const { decodeProtobuf, parseInput } = require("decode-protobuf");
// Decode a binary protobuf message
const decoded = decodeProtobuf(parseInput(binaryData));
console.log(decoded);You can, for example, take a got response body, feed it into decodeProtobuf and get an object.
License
MIT
