Registry / devops / trooba-grpc-transport

trooba-grpc-transport

JSON →
library1.2.0jsnpmunverified

gRPC transport for the Trooba pipeline, version 1.2.0. This package provides both client and service (server) side gRPC transport implementations integrated with the Trooba pipe-and-filter architecture. It uses @grpc/grpc-js under the hood, supporting protobuf definitions and serialization. The release cadence is sporadic; the package has not been updated since 2020. Key differentiators: lightweight gRPC integration within Trooba pipelines, enabling middleware patterns like logging, authentication, and transformation for gRPC calls. Compared to standalone gRPC libraries, it leverages Trooba's composable pipeline model.

npm install trooba-grpc-transport
INSTALL
IMPORT
SIG · TROOBA-GRPC-TRANSP
T
trooba-grpc-transport
devopsjavascriptv1.2.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.

trooba-grpc-transport
const grpcTransport = require('trooba-grpc-transport');
import grpcTransport from 'trooba-grpc-transport';
Package does not ship TypeScript types; use commonjs require. ESM import may fail.
trooba
const trooba = require('trooba');
Trooba is the pipeline framework; must be installed separately.
Grpc (from @grpc/grpc-js)
const grpc = require('@grpc/grpc-js');
Used when loading proto files manually for service definition.

Shows how to create a gRPC client and server using Trooba pipeline with trooba-grpc-transport.

const trooba = require('trooba'); const grpcTransport = require('trooba-grpc-transport'); const grpc = require('@grpc/grpc-js'); const protoLoader = require('@grpc/proto-loader'); const PROTO_PATH = './hello.proto'; const port = 50051; // Client const client = trooba .use(grpcTransport, { protocol: 'http:', hostname: 'localhost', port: port, proto: protoLoader.loadSync(PROTO_PATH), connectTimeout: 100, socketTimeout: 1000 }) .build('client:default'); client.SayHello({ name: 'World' }, (err, response) => { if (err) console.error(err); else console.log('Greeting:', response.message); }); // Server (requires trooba helper) const server = trooba .use(grpcTransport, { port: port, hostname: 'localhost', proto: grpc.loadPackageDefinition(protoLoader.loadSync(PROTO_PATH)).hello }) .use(function handler(pipe) { pipe.on('request', (request, next) => { console.log('Received:', request.name); next(); }); }) .build('service');
Debug
Known issues
deprecatedThis package relies on @grpc/grpc-js which may have breaking changes in newer versions.
fix
Pin @grpc/grpc-js and @grpc/proto-loader versions compatible with this transport.
affects: >=1.0.0
gotchaThe package returns a function that must be passed to trooba.use() as a middleware. Do not call it directly.
fix
Use .use(grpcTransport, options) syntax.
affects: *
gotchaProto path must be resolved to an absolute path or loaded via proto-loader; relative paths may fail.
fix
Use require.resolve() or protoLoader.loadSync with full path.
affects: *
Errors
Common errors & fixes
Error: Cannot find module '@grpc/grpc-js'
@grpc/grpc-js is a peer dependency not automatically installed.
fix
Run: npm install @grpc/grpc-js @grpc/proto-loader
TypeError: trooba.use is not a function
Trooba is not installed or incorrectly imported.
fix
Install trooba: npm install trooba
Error: ENOENT: no such file or directory, open 'path/to/hello.proto'
Proto file path is relative and not resolved correctly.
fix
Use require.resolve('./hello.proto') or absolute path.
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
troobarequiredRequired to build and use the pipeline; the transport is a plugin for trooba.
@grpc/grpc-jsrequiredCore gRPC implementation used for client and server communication.
@grpc/proto-loaderrequiredUsed to load .proto files at runtime.
Agent activity
4 hits · last 30 days
node
4
Resources