Registry / testing / ges

ges

JSON →
library1.3.1jsnpmunverified

A gRPC experimental server that adds koa-like interceptors (middleware) to gRPC calls. Current stable version is 1.3.1. The package wraps the official grpc package and provides a middleware pattern similar to Koa.js for handling unary, client streaming, server streaming, and bidirectional streaming calls. It simplifies adding cross-cutting concerns like logging, tracing, and authentication. The package requires peer dependency grpc ^1.22.2 and is specific to Node.js. It is distinct from other gRPC middleware solutions by its Koa-style request/response pipeline.

testing
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.

Default export, not named. Use default import syntax.

import ExperimentalServer from 'ges';

For CommonJS, the default export is directly on module.exports.

const ExperimentalServer = require('ges');

No named type export; the type is inferable from default import.

import ExperimentalServer from 'ges';

Shows how to create a gRPC server with a koa-like interceptor for logging request duration.

import ExperimentalServer from 'ges'; import * as grpc from 'grpc'; const server = new ExperimentalServer(); // Define a service (example HelloService) const helloProto = grpc.load('hello.proto'); const helloService = helloProto.helloworld.Greeter.service; server.addService(helloService, { sayHello: (call, callback) => { callback(null, { message: 'Hello ' + call.request.name }); } }); // Add interceptor server.use(async (context, next) => { const start = Date.now(); try { await next(); } finally { console.log('Request took', Date.now() - start, 'ms'); } }); server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure()); server.start(); console.log('Server running on port 50051');
Debug
Known footguns
gotchaserver.use() interceptors must call await next() to continue the pipeline; otherwise subsequent handlers are skipped.
gotchaThe package has a typo in the README: 'serer.bind' should be 'server.bind'.
deprecatedgrpc is deprecated in favor of @grpc/grpc-js.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
3
ahrefsbot
1
Resources
packageges