Registry / devops / saas-grpc-library

saas-grpc-library

JSON →
library1.0.28jsnpmunverified

A NestJS library for centralizing and abstracting gRPC communication between microservices. Current stable version is 1.0.28. It provides tooling to generate TypeScript interfaces from .proto files and simplifies the setup of gRPC clients and servers in NestJS applications. The library is designed for Node.js 20+ and uses protocol buffers for service definitions. It differentiates itself by tightly integrating with NestJS decorators and module system, reducing boilerplate for gRPC microservices.

npm install saas-grpc-library
INSTALL
IMPORT
SIG · SAAS-GRPC-LIBRARY
S
saas-grpc-library
devopsjavascriptv1.0.28
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.

GrpcModule
import { GrpcModule } from 'saas-grpc-library';
const GrpcModule = require('saas-grpc-library').GrpcModule;
Library is ESM-only; CommonJS require is not supported.
GrpcClient
import { GrpcClient } from 'saas-grpc-library';
import { GrpcClient } from 'saas-grpc-library/src/core';
Use top-level export, not internal path.
protobufPackageExample
import { protobufPackageExample } from 'saas-grpc-library';

Registers the gRPC module with a proto file and connection URL in a NestJS app.

import { Module } from '@nestjs/common'; import { GrpcModule } from 'saas-grpc-library'; @Module({ imports: [ GrpcModule.register({ protoPath: 'path/to/example.proto', package: 'example', url: 'localhost:50051', }), ], }) export class AppModule {}
Debug
Known issues
gotchaAfter generating interfaces from .proto files, you must manually change the default protobufPackage name in the generated file.
fix
Edit the generated file (e.g., src/interface) to export a properly named constant like 'export const protobufPackage = "yourPackage";'
affects: >=1.0.0
gotchaLibrary requires Node.js version 20 or higher; using older versions may cause runtime errors.
fix
Update Node.js to version 20+.
affects: >=1.0.0
gotchaThe library is ESM-only; CommonJS (require) imports will fail.
fix
Use ES module import syntax or set 'type': 'module' in package.json.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'saas-grpc-library'
Package not installed or not in node_modules.
fix
Run 'npm install saas-grpc-library' or 'pnpm add saas-grpc-library'.
TypeError: GrpcModule.register is not a function
Import typo or wrong import path.
fix
Ensure you import 'GrpcModule' correctly: import { GrpcModule } from 'saas-grpc-library';
Error: protobuf package must be specified
Missing 'package' option in GrpcModule.register.
fix
Provide the 'package' field matching the proto package name.
Upgrade
Version history
1.0.28latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
saas-grpc-library — npm install saas-grpc-library · libregistry