Reads a protobuf schema from disk, parses it, and resolves all imports, producing a combined parsed schema. Current stable version is 2.1.0, with no recent updates. It is a lightweight utility for Node.js environments, offering both async and sync API. Unlike other protobuf parsers, it focuses solely on schema resolution without parsing .proto files into runtime objects. Requires protobufjs (peek-readable) for parsing. Release cadence is low; no breaking changes expected.
npm install resolve-protobuf-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates synchronous resolution of a .proto file, returning a parsed schema object with resolved imports.
Always provide absolute paths or paths relative to process.cwd().
Ensure imported files exist relative to the importing file's location.
Consider alternatives like protobufjs that include schema resolution.
Use an absolute path or check the relative path from the working directory.
Use `import resolve from 'resolve-protobuf-schema'` for async, or `import { sync } from '...'` for sync.