A library (v0.3.3, pre-1.0) for converting HTTP REST requests into gRPC calls at runtime, enabling gradual migration from REST to gRPC without rewriting clients. Unlike code-generation tools (e.g., grpc-gateway), it uses dynamic proto reflection to translate REST endpoints to gRPC methods on the fly. Low release cadence, experimental. Ships TypeScript types.
npm install rest2grpcNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows initializing rest2grpc with proto files and converting a REST request to a gRPC call.
Pin exact version and test upgrades.
Use import syntax or enable ESM in your project.
Ensure protoDir points to a directory containing the .proto files referenced in protoFiles.
Use 'protoFiles' instead of 'files' in the options object.
Wrap in try/catch and inspect error.code and error.details.
Replace require('rest2grpc') with import rest2grpc from 'rest2grpc'.Use absolute paths via path.resolve() or __dirname.
Verify the path format matches '<package>.<service>/<method>' exactly as in proto definition.
Ensure await rest2grpc(...) completes before using the converter function.