resolve-protobuf-schema

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

MIT 5 个版本
安装
npm install resolve-protobuf-schema
yarn add resolve-protobuf-schema
pnpm add resolve-protobuf-schema
bun add resolve-protobuf-schema
README

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

版本列表
2.1.0 2018-07-20
2.0.0 2015-07-02
1.0.2 2014-10-12
1.0.1 2014-10-12
1.0.0 2014-10-12