Skip to content

akkurat/protobufjs-textformat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Javascript protobuf text format parser and encoder

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 81.2%
  • PureBasic 18.8%