resolve-protobuf-schema
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/resolve-protobuf-schema package

2.1.0 • Public • Published

resolve-protobuf-schema

Read a protobuf schema from the disk, parse it and resolve all imports

npm install resolve-protobuf-schema

build status

Usage

Store the following example protobuf schema in test.proto

message Test {
  optional string test = 1;
}

Then run

var resolve = require('resolve-protobuf-schema')
console.log(resolve.sync('test.proto')) // prints the parsed schema

Schema imports will resolved as well

import "./test.proto"

message AnotherTest {
  optional string test = 1;
}
console.log(resolve.sync('./another-test.proto')) // will print a combined parsed schema

API

  • resolve(path, cb) read and resolve a schema
  • resolve.sync(path) sync version of resolve

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i resolve-protobuf-schema

Weekly Downloads

1,348,645

Version

2.1.0

License

MIT

Unpacked Size

5.24 kB

Total Files

9

Last publish

Collaborators

  • mafintosh