better-grpc is a TypeScript-first gRPC library (version 0.3.2) that eliminates the need for .proto files and code generation, offering full type safety and autocompletion. It enables bidirectional communication where client and server can call each other's functions as if local. Released under MIT, it supports Node.js >=18 and TypeScript ^5. Simpler than raw gRPC-js but less mature than tRPC; no streaming support yet (only simple RPCs).
npm install better-grpcNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Defines a simple service, implements server and client halves, starts server and client, makes a remote call, and logs the result.
Use 'client' as a named function, but avoid naming your variables 'client' to prevent confusion.
Provide a unique string name for each Service definition.
Update calls to include options object if needed, or omit for default.
Implement client methods in the MyService.Client({...}) object.Use 'ssl', 'insecure', or an options object as the second argument (before clientImpl).
Ensure you use Service('MyService') with parentheses: class MyService extends Service('MyService') {}Use 'ssl', 'insecure', or an object with gRPC channel options: createGrpcClient(address, creds?, impl)
Ensure createGrpcClient is called with a client implementation object: createGrpcClient(address, impl)