Pure JavaScript implementation of gRPC for Node.js, maintained by the official gRPC team. Current version v1.0.1 supports Node >=12.10.0. Designed as a drop-in replacement for the deprecated grpc package (C++ addon), offering features such as client/server streaming, automatic reconnection, round-robin/pick-first load balancing, connection keepalives, HTTP CONNECT proxies, and partial compression. Does not handle .proto files directly, relying on @grpc/proto-loader instead. Ships TypeScript types. Updated regularly, with semver guarantees but some internal methods prefixed with underscores.
npm install grpc-js-vNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a gRPC client from a .proto file, calls an RPC, and prints the response.
Use server.bindAsync(port, creds, callback) instead of server.bind(port, creds)
Replace require('grpc') with require('@grpc/grpc-js') and adjust usage as per migration guideReplace grpc.load() with protoLoader.loadSync() + loadPackageDefinition()
Check supported channel options list in docs; unknown options may silently fail
Ensure proto definition is loaded correctly, e.g., const proto = loadPackageDefinition(packageDefinition).helloworld;
Ensure the server has a handler for the service, e.g., server.addService(proto.Greeter.service, { sayHello: (call, callback) => { ... } })Install the dependency: npm install @grpc/proto-loader