Utility to convert gRPC client methods generated by @grpc/grpc-js from callback-based to Promise-based, with full TypeScript type declaration support. Current version is 4.0.0-alpha.1, which is an alpha release. The library wraps each client method to return a Promise, preserving the original method signatures and types. It differentiates from generic promisification libraries by being specifically tailored to @grpc/grpc-js generated clients, ensuring correct handling of gRPC errors and metadata. Suitable for projects migrating from callbacks to async/await.
npm install promisify-grpc-clientNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates importing the default function, creating a gRPC client, promisifying it, and using async/await to call a method.
Use ES module import or downgrade to v3.x if CommonJS required.
Use at your own risk; pin to exact version and test thoroughly.
Ensure you are using @grpc/grpc-js and the generated client classes.
Use import type { PromisifiedClient } from 'promisify-grpc-client'; to avoid runtime import.Check the documentation for which methods are supported. Use a different pattern for streaming methods.
Set "type": "module" in package.json, or use .mjs extension, or downgrade to v3.x.
Ensure the client is generated by @grpc/grpc-js and that you are using the correct service client.
Install google-protobuf: npm install google-protobuf