Registry / communication / pip-services3-grpc-node

pip-services3-grpc-node

JSON →
library3.2.1jsnpmunverified

Provides gRPC communication components for the Pip.Services microservice toolkit (Node.js). Version 3.2.1 is current stable with monthly releases. Includes factories, client and server implementations for synchronous data exchange via gRPC, supporting both raw gRPC and Commandable patterns. Ships TypeScript definitions. Requires underlying Pip.Services core containers and RPC components (pip-services3-container-node, pip-services3-rpc-node) plus google-protobuf and grpc packages.

npm install pip-services3-grpc-node
INSTALL
IMPORT
SIG · PIP-SERVICES3-GRPC
P
pip-services3-grpc-node
communicationjavascriptv3.2.1
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 'pip-services3-grpc-node'
const { GrpcClient } = require('pip-services3-grpc-node')
Package is ESM-only? Actually supports both CJS and ESM but TypeScript imports recommended.
GrpcService
import { GrpcService } from 'pip-services3-grpc-node'
import GrpcService from 'pip-services3-grpc-node'
Named export, not default.
CommandableGrpcClient
import { CommandableGrpcClient } from 'pip-services3-grpc-node'
const CommandableGrpcClient = require('pip-services3-grpc-node').CommandableGrpcClient
For CJS, require the named export properly.

Creates a gRPC client, configures connection, opens, makes a call, and closes.

import { GrpcClient } from 'pip-services3-grpc-node'; import { ConfigParams } from 'pip-services3-commons-node'; async function main() { const client = new GrpcClient(); client.configure(ConfigParams.fromTuples( 'connection.protocol', 'grpc', 'connection.host', 'localhost', 'connection.port', 50051 )); await client.open(null); const response = await client.call('my_method', { requestParam: 'value' }); console.log('Response:', response); await client.close(null); } main().catch(console.error);
Debug
Known issues
deprecatedThe 'grpc' npm package has been deprecated; migrate to '@grpc/grpc-js'
fix
Replace dependency on 'grpc' with '@grpc/grpc-js' and update imports.
affects: >=3.0.0
breakingVersion 3.0.0 changed the package name from 'pip-services-grpc-node' to 'pip-services3-grpc-node'
fix
Update package name in package.json and imports.
affects: >=3.0.0
gotchaCommandableGrpcClient requires a registered CommandSet on the service side; otherwise calls may fail with 'No command found'
fix
Ensure your service exposes commands via CommandSet.
affects: >=2.0.0
deprecatedGrpcClient.call() method is deprecated in favor of GrpcClient.invoke() for better error handling
fix
Use client.invoke(method, data) instead of client.call(method, data).
affects: >=3.0.0
Errors
Common errors & fixes
Error: 14 UNAVAILABLE: io.grpc.StatusRuntimeException: UNAVAILABLE: Connection refused
gRPC server is not running or unreachable
fix
Start the gRPC service and verify host/port configuration.
Error: Cannot find module 'pip-services3-grpc-node'
Package not installed or incorrectly imported
fix
Run 'npm install pip-services3-grpc-node' and ensure import path is correct.
TypeError: grpc.loadPackageDefinition is not a function
Incompatible version of 'grpc' package (deprecated) with newer @grpc/grpc-js
fix
Switch to '@grpc/grpc-js' and adjust proto loading as per the new API.
Error: No command found for method 'my_method'
Service does not have a registered CommandSet or the command name is wrong
fix
Register a CommandSet on the service containing 'my_method' command.
Upgrade
Version history
3.2.1latest on npm
Audit
Dependencies
pip-services3-container-noderequiredProvides the microservice container base classes
pip-services3-rpc-noderequiredProvides RPC client and service base patterns used by gRPC
google-protobufrequiredRequired for protocol buffer message serialization
grpcrequiredThe underlying gRPC framework for Node.js
Agent activity
15 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
pip-services3-grpc-node — npm install pip-services3-grpc-node · libregistry