From 5fd64add93ffc70e23ffa1974a9a4ef7598c859f Mon Sep 17 00:00:00 2001 From: hansi Date: Mon, 3 Mar 2025 05:37:57 +0400 Subject: [PATCH] fix(docs): fix invalid method path and update grpc npm package --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 46752a93d..9c930c921 100644 --- a/README.md +++ b/README.md @@ -410,9 +410,9 @@ function rpcImpl(method, requestData, callback) { } ``` -Below is a working example with a typescript implementation using grpc npm package. +Below is a working example with a typescript implementation using the `@grpc/grpc-js` npm package. ```ts -const grpc = require('grpc') +const grpc = require('@grpc/grpc-js') const Client = grpc.makeGenericClientConstructor({}) const client = new Client( @@ -421,8 +421,10 @@ const client = new Client( ) const rpcImpl = function(method, requestData, callback) { + const methodPath = `/${method.parent.fullName.slice(1)}/${method.name}`; + client.makeUnaryRequest( - method.name, + methodPath, arg => arg, arg => arg, requestData,