protobufjs-textformat

1.1.1 • Public • Published

Parser for TextFormat protobuf messages.

Usage

const sut = require('protobufjs-textformat')
const ProtoBuf = require('protobufjs')
const fqn = 'google.fonts_public.FamilyProto';
// load protobuf definition
const root = await (new ProtoBuf.Root()).load('fonts_public.proto', { keepCase: true })

// load text based protobuf data
const input = fs.readFileSync('METADATA.pb', 'utf-8');
const result = sut.parse(root, fqn, input), message = result.message;

console.log(message)

For usage of protobufjs itself see https://github.com/protobufjs/protobuf.js?tab=readme-ov-file#examples

Package Sidebar

Install

npm i protobufjs-textformat

Weekly Downloads

6

Version

1.1.1

License

MIT

Unpacked Size

50.9 kB

Total Files

14

Last publish

Collaborators

  • akkurat