Registry / testing / grpc-man

grpc-man

JSON →
library1.8.0jsnpmunverified

grpc-man is a lightweight gRPC client library for Node.js that allows calling gRPC server methods dynamically at runtime. Version 1.8.0 is the latest stable release, with active maintenance and updates. It supports both programmatic use in JavaScript/TypeScript projects and command-line usage for quick verification of gRPC services. Unlike generated gRPC clients, grpc-man can load .proto files at runtime and invoke methods without code generation, making it ideal for testing and debugging. It ships TypeScript definitions and requires Node.js >=8.9.0.

npm install grpc-man
INSTALL
IMPORT
SIG · GRPC-MAN
G
grpc-man
testingjavascriptv1.8.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GrpcClient
import GrpcClient from 'grpc-man/lib/Client';
import { GrpcClient } from 'grpc-man';
The library does not have a default export at the package root; you must import from the specific path 'grpc-man/lib/Client'. The import path is case-sensitive.
Client
import Client from 'grpc-man/lib/Client';
import Client from 'grpc-man';
The class is named GrpcClient in the source, but you can alias it as Client when importing. The library also exports Client as a named export from 'grpc-man/lib/Client'.
grpc-man (CLI)
grpc-man <endpoint> <protoFilePath>
npx grpc-man <endpoint>
The CLI requires both endpoint and proto file path as arguments. Running without arguments shows help.
GrpcClient instance
const client = new GrpcClient('localhost:50051', './path/to/service.proto');
const client = new GrpcClient('localhost', './path/to/service.proto');
The endpoint must include the port (e.g., 'localhost:50051'). Omitting the port causes a connection error.

Demonstrates importing GrpcClient, creating a client with endpoint and proto file path, and calling a gRPC method.

import GrpcClient from 'grpc-man/lib/Client'; async function main() { const client = new GrpcClient('0.0.0.0:8890', './proto/helloworld.proto'); const res = await client.grpc.helloworld.Greeter.sayHello({ name: 'World' }); console.log(res); // { message: 'Hello World' } } main().catch(console.error);
Debug
Known issues
gotchaThe import path 'grpc-man/lib/Client' is case-sensitive and may vary on different filesystems.
fix
Use exact path 'grpc-man/lib/Client' in imports.
affects: >=1.0.0
breakingIn version 1.7.0, the method signature for Client constructor changed to accept endpoint and protoPath as separate arguments.
fix
Update code: new Client(endpoint, protoPath) instead of passing an object.
affects: >=1.7.0
deprecatedThe package relies on the deprecated 'grpc' npm package (not '@grpc/grpc-js'), which may have compatibility issues with newer Node.js versions.
fix
Consider switching to '@grpc/grpc-js' and updating the library or using an alternative.
affects: <2.0.0
gotchaIf the proto file contains packages, you must prefix method calls with the package name (e.g., client.grpc.mypackage.MyService.myMethod).
fix
Check proto file for package declaration and include it in the call chain.
affects: >=1.0.0
gotchaThe library does not support SSL/TLS by default; connections are insecure.
fix
For secure connections, use a different gRPC client library that supports credentials.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'grpc-man/lib/Client'
Import path is incorrect; maybe using 'grpc-man' without '/lib/Client' or typo.
fix
Use correct import: import GrpcClient from 'grpc-man/lib/Client';
Error: ENOENT: no such file or directory, open '.../path/to/protofile.proto'
Proto file path is incorrect or file missing.
fix
Provide the absolute or correct relative path to the .proto file.
Error: 14 UNAVAILABLE: failed to connect to all addresses
gRPC server is not running or endpoint is wrong.
fix
Ensure the gRPC server is started and the endpoint (host:port) is correct.
TypeError: client.grpc.helloworld.Greeter.sayHello is not a function
Proto file does not define the method or package path is incorrect.
fix
Inspect the proto file for correct service and method names, and include package prefixes if any.
Upgrade
Version history
1.8.0latest on npm
Audit
Dependencies
grpcrequiredCore gRPC library for client-server communication
protobufjsrequiredUsed for loading .proto files at runtime
Agent activity
13 hits · last 30 days
node
12
Resources
grpc-man — npm install grpc-man · libregistry