Registry / devops / node-grpc-microservice-kit

node-grpc-microservice-kit

JSON →
library3.3.0jsnpmunverified

A gRPC library for Node.js designed to simplify building microservices with gRPC. Version 3.3.0 is the latest stable release. It provides utilities for server and client creation, middleware support, error handling, and service registry integration. Unlike bare gRPC, it offers higher-level abstractions such as automatic reconnection, health checks, and load balancing. Release cadence is irregular. Key differentiators include built-in observability hooks and declarative service definitions.

npm install node-grpc-microservice-kit
INSTALL
IMPORT
SIG · NODE-GRPC-MICROSER
N
node-grpc-microservice-kit
devopsjavascriptv3.3.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.

GrpcMicroserviceKit
import { GrpcMicroserviceKit } from 'node-grpc-microservice-kit'
const GrpcMicroserviceKit = require('node-grpc-microservice-kit')
ESM import since v3; CJS require may fail.
createServer
import { createServer } from 'node-grpc-microservice-kit'
const { createServer } = require('node-grpc-microservice-kit').default
Named export, not default.
createClient
import { createClient } from 'node-grpc-microservice-kit'
import createClient from 'node-grpc-microservice-kit'
Not a default export.

Shows server and client creation using a protobuf definition, async call with API key auth.

import { createServer, createClient } from 'node-grpc-microservice-kit'; import { join } from 'path'; const PROTO_PATH = join(__dirname, 'hello.proto'); async function main() { const server = await createServer({ protoPath: PROTO_PATH, package: 'hello', service: 'Greeter', implementation: { sayHello: (call, callback) => { callback(null, { message: `Hello ${call.request.name}` }); }, }, }); const addr = '0.0.0.0:50051'; await server.start(addr); const client = await createClient({ protoPath: PROTO_PATH, package: 'hello', service: 'Greeter', target: addr, apiKey: process.env.API_KEY ?? '', }); const response = await client.sayHelloAsync({ name: 'world' }); console.log(response.message); server.shutdown(); } main().catch(console.error);
Debug
Known issues
breakingESM-only since v3.0.0; CJS require will break.
fix
Use ESM imports (import) or downgrade to v2.x for CommonJS.
affects: >=3.0.0
gotchaPackage does not include protobuf compilation; you must provide compiled proto files or use dynamic loading.
fix
Ensure proto files are accessible and protoPath points to correct file.
affects: >=1.0.0
deprecatedThe 'credentials' option in createClient is deprecated in favor of 'apiKey' or custom interceptors.
fix
Use 'apiKey' parameter or pass credentials via 'interceptors'.
affects: >=3.0.0 <4.0.0
gotchaHealth check is not enabled by default; must be explicitly configured.
fix
Pass 'healthCheck: true' to server options.
affects: >=1.0.0
breakingThe 'sayHelloAsync' method signature changed from (req, metadata) to (req, metadata?, timeout?)
fix
Update calls to include optional parameters correctly.
affects: >=3.2.0
Errors
Common errors & fixes
Error: Cannot find module 'node-grpc-microservice-kit'
Package not installed or incorrect import path due to missing ESM configuration.
fix
Run 'npm install node-grpc-microservice-kit' and ensure 'type': 'module' in package.json for ESM projects.
TypeError: createServer is not a function
Using CommonJS require with ESM-only package v3.
fix
Switch to ESM imports: 'import { createServer } from 'node-grpc-microservice-kit''.
Error: PROTO_PATH must point to a valid .proto file
Missing proto file or directory does not exist.
fix
Ensure proto file exists at specified path and use absolute path if necessary.
Error: 14 UNAVAILABLE: failed to connect to all addresses
gRPC server not running or unreachable.
fix
Verify server is started on correct address/port and check network connectivity.
Upgrade
Version history
3.3.0latest on npm
Audit
Dependencies
@grpc/grpc-jsrequiredCore gRPC implementation for Node.js.
protobufjsrequiredProtobuf serialization/deserialization.
Agent activity
4 hits · last 30 days
node
4
Resources
node-grpc-microservice-kit — npm install node-grpc-microservice-kit · libregistry