Registry / devops / gioneco-grpc

gioneco-grpc

JSON →
library1.1.6jsnpmunverified

A Node.js library for building gRPC servers and clients with Consul service discovery. Current version 1.1.6, released on npm. Provides GrpcServer and GrpcClient classes that load .proto files, handle service registration via Consul, and support both callback and promisified patterns. Differentiates from other gRPC libraries by tightly integrating service discovery through Consul or Nacos, making it suitable for microservice architectures. It uses the official @grpc/grpc-js under the hood.

npm install gioneco-grpc
INSTALL
IMPORT
SIG · GIONECO-GRPC
G
gioneco-grpc
devopsjavascriptv1.1.6
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.

GrpcServer
import { GrpcServer } from 'gioneco-grpc'
ESM default import works as named import.
GrpcClient
import { GrpcClient } from 'gioneco-grpc'
const GrpcClient = require('gioneco-grpc').GrpcClient
Library provides named exports; CommonJS destructuring also works.
ServiceRegistry
import { ServiceRegistry } from 'gioneco-grpc'
Used for configuring service discovery.

Shows how to create a gRPC server and client with Consul service discovery.

import { GrpcServer, GrpcClient, ServiceRegistry } from 'gioneco-grpc'; const registry = new ServiceRegistry({ host: '127.0.0.1', port: 8500 }); const server = new GrpcServer({ protosDir: `${process.cwd()}/protos`, serviceFunctionMap: { 'helloworld.SayHello': (call, callback) => { callback(null, { message: 'Hello ' + call.request.name }); } }, registry, checkServerPort: 1338 }); server.ready(); const client = new GrpcClient({ protosDir: `${process.cwd()}/protos`, registry }); setTimeout(() => { const grpcClient = client.getGrpcClient('helloworld'); if (grpcClient) { grpcClient.sayHello({ name: 'world' }, (err, response) => { if (err) throw err; console.log(response.message); }); } }, 500);
Debug
Known issues
gotchaServiceRegistry uses Consul port 8500 by default; if using different port, specify it.
fix
Always pass explicit port to ServiceRegistry.
affects: >=1.0
breakingServiceFunctionMap keys must be 'package.service' format; incorrect casing causes silent failure.
fix
Use exact proto package and service names as defined in .proto files.
affects: >=1.0
gotchagetGrpcClient may return null if service not found; must check before calling methods.
fix
Always check if client is null before invoking RPC.
affects: >=1.0
deprecatedCallback-style usage is supported but promisify option via ServiceRegistry is preferred for async/await.
fix
Set ServiceRegistry promisify: true to enable promise-based client calls.
affects: >=1.0
gotchaprotosDir must point to a directory containing .proto files; dynamic loading is not supported.
fix
Use absolute or relative path to a folder with .proto files.
affects: >=1.0
Errors
Common errors & fixes
Error: 13 INTERNAL: Received rpc response after deadline
Consul service not running or incorrect host/port
fix
Ensure Consul agent is running on the specified host and port.
TypeError: grpcClient.sayHello is not a function
Incorrect service name in getGrpcClient or wrong proto definition
fix
Verify the service name matches exactly (e.g., 'helloworld') and that the .proto file defines the 'SayHello' RPC.
Error: NOT_FOUND: Service 'helloworld' not registered
Service not yet registered with Consul or registry not initialized
fix
Wait for server.ready() to complete and ensure registry is configured correctly.
Upgrade
Version history
1.1.6latest on npm
Audit
Dependencies
@grpc/grpc-jsrequiredgRPC client/server implementation
@grpc/proto-loaderrequiredLoad .proto files
consulrequiredService registration and discovery with Consul
Agent activity
4 hits · last 30 days
node
4
Resources
gioneco-grpc — npm install gioneco-grpc · libregistry