2.1.0 • Published 7 years ago
resolve-protobuf-schema v2.1.0
resolve-protobuf-schema
Read a protobuf schema from the disk, parse it and resolve all imports
npm install resolve-protobuf-schemaUsage
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 schemaSchema 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 schemaAPI
resolve(path, cb)read and resolve a schemaresolve.sync(path)sync version ofresolve
License
MIT