
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
@betsys-nestjs/grpc
Advanced tools
Library for bootstrapping grpc hybrid application and health checking of grpc
This library is responsible bootstraping GRPC application and providing GRPC client for health checking.
| Package | Version |
|---|---|
| @grpc/grpc-js | ^1.8.0 |
| @nestjs/common | ^10.0.0 |
| @nestjs/microservices | ^10.0.0 |
| @nestjs/core | ^10.0.0 |
| @nestjs/terminus | ^10.0.0 |
| reflect-metadata | ^0.1.13 |
| rxjs | ^7.8.0 |
To start using this library simply import GrpcBuilder in main.ts as an entry point of Nest application.
const {app, microservice} = await GrpcBuilder.createGrpcApplication(
TestModule,
{
options: {
url: '0.0.0.0:<port>',
package: ['<package>'],
protoPath: ['<protoPath>'],
loader: {
includeDirs: [
'<pathToProtobuff>'
],
},
},
health: true,
},
)
Then if you enable health checking for the GRPC
you want to use GrpcHealthClientModule to initialize GRPC client for calling health check endpoint.
At the place where you want to use GRPC client simply do:
GrpcHealthClientModule.register(port, directoryOfProtofile)
You always need to define port, that would match the port of running
GRPC server, and optionally you can define path of proto file with second parameter of register method.
Then you can inject service to any module and use it like this to call the actual health check method:
class HealthIndicator {
constructor(private readonly grpcHealthClientService: GrpcHealthClientService) {
}
async isHealthy() {
await this.grpcHealthClientService.check()
}
}
FAQs
Library for bootstrapping grpc hybrid application and health checking of grpc
The npm package @betsys-nestjs/grpc receives a total of 0 weekly downloads. As such, @betsys-nestjs/grpc popularity was classified as not popular.
We found that @betsys-nestjs/grpc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.