Registry / messaging / grpc-client-ts

grpc-client-ts

JSON →
library1.1.1jsnpmunverified

A TypeScript-based gRPC client module that works with the companion server module grpc-server-ts. Version 1.1.1 provides a decorator-based API using @Client and @Route for defining gRPC service methods, and a registry pattern via RpcClientRegistry for managing client connections with TLS support. The package ships TypeScript types and is designed for Node.js environments. Compared to other gRPC clients like @grpc/grpc-js, it abstracts away much of the boilerplate but is tightly coupled to its own server module and the mvc-ts framework, limiting broader adoption. Release cadence appears low, with no recent updates.

npm install grpc-client-ts
INSTALL
IMPORT
SIG · GRPC-CLIENT-TS
G
grpc-client-ts
messagingjavascriptv1.1.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.

Client
import { Client } from 'grpc-client-ts'
const { Client } = require('grpc-client-ts')
ESM-only since v1.0; CommonJS require will fail if the package is not transpiled.
Route
import { Route } from 'grpc-client-ts'
import { Route } from 'grpc-client-ts/src/Route'
Route is a decorator used on methods; import from the package root not a subpath.
RpcClientRegistry
import { RpcClientRegistry, Settings } from 'grpc-client-ts'
const RpcClientRegistry = require('grpc-client-ts').RpcClientRegistry
RpcClientRegistry is a class that must be extended and decorated with @Settings.

Shows defining a gRPC client with proto file, decorators, and TLS configuration.

import { Route, Client, RpcClientRegistry, Settings } from 'grpc-client-ts'; // Define a proto file and client @Client(__dirname + '/protos/hello.proto') export class HelloClient { @Route public async say(data: any, result: any) {} } // Configure and start client registry const settings = { port: '3333', host: 'localhost', ca: 'certs/ca.crt', client_cert: 'certs/client.crt', client_key: 'certs/client.key' }; @Settings(settings) class MyClient extends RpcClientRegistry {} const client = new MyClient(); client.start();
Debug
Known issues
gotchaRequires companion grpc-server-ts module; not compatible with other gRPC servers.
fix
Use @grpc/grpc-js for general-purpose gRPC client if not using grpc-server-ts.
affects: >=1.0
breakingESM-only; no CommonJS support, requiring Node.js >=12 or transpilation.
fix
Use import syntax or transpile with TypeScript/ESBuild.
affects: >=1.0
deprecatedPackage relies on decorators that may require experimentalDecorators in tsconfig.
fix
Enable 'experimentalDecorators': true in tsconfig.json.
affects: >=1.0
Errors
Common errors & fixes
TypeError: Class extends value undefined is not a constructor or null
RpcClientRegistry is not imported correctly (CommonJS vs ESM).
fix
Use import { RpcClientRegistry } from 'grpc-client-ts' instead of require().
Cannot find module 'grpc-server-ts'
Missing companion server module required at runtime.
fix
Install grpc-server-ts: npm install grpc-server-ts
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies
grpc-server-tsoptionalRequired companion server module for proper client-server communication.
Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
grpc-client-ts — npm install grpc-client-ts · libregistry