@f1stnpm2/atque-commodi-ab
v1.0.0
Published
Parser for TextFormat protobuf messages.
Downloads
8
Maintainers
Keywords
Readme
Parser for TextFormat protobuf messages.
Usage
const sut = require('@f1stnpm2/atque-commodi-ab')
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