JSPM

resolve-protobuf-schema

2.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2335005
  • Score
    100M100P100Q215526F
  • License MIT

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

Package Exports

  • resolve-protobuf-schema

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (resolve-protobuf-schema) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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