@patrten/et-ipsam

1.0.0 • Public • Published

Parser for TextFormat protobuf messages.

Usage

const sut = require('@patrten/et-ipsam')
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

Readme

Keywords

Package Sidebar

Install

npm i @patrten/et-ipsam

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

21.6 kB

Total Files

14

Last publish

Collaborators

  • minhtran645176