ngx-open-map-wrapper/node_modules/resolve-protobuf-schema
2025-09-29 14:55:14 -04:00
..
test add addzone and update zone in map-adapter interface 2025-09-29 14:55:14 -04:00
.travis.yml add addzone and update zone in map-adapter interface 2025-09-29 14:55:14 -04:00
index.js add addzone and update zone in map-adapter interface 2025-09-29 14:55:14 -04:00
LICENSE add addzone and update zone in map-adapter interface 2025-09-29 14:55:14 -04:00
package.json add addzone and update zone in map-adapter interface 2025-09-29 14:55:14 -04:00
README.md add addzone and update zone in map-adapter interface 2025-09-29 14:55:14 -04:00

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