Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@fonoster/grpc-health-check

fonoster515MIT3.1.6TypeScript support: included

An implementation of gRPC health checks, written in typescript.

grpc, health, check, health-check, typescript

readme

gRPC Health Check

An implementation of gRPC health checks, for node.js-based apps that uses @grpc/grpc-js as a base.

Installation

yarn add git+https://github.com/fonoster/grpc-health-check.git

Usage

/**
 * server.ts
 */
import * as grpc from '@grpc/grpc-js';
import { useHealth } from '@fonoster/grpc-health-check';

const server = useHealth(new grpc.Server());

server.bindAsync('0.0.0.0:50051', grpc.ServerCredentials.createInsecure(), () => server.start());
/**
 * client.ts
 */
import * as grpc from '@grpc/grpc-js';
import { HealthClient } from '@fonoster/grpc-health-check';

const health = new HealthClient('localhost:50051');

const { status } = await health.check('SERVICE');

console.info('The app is ready to serve!', status);

Authors

This repository is a clone of kalos, thanks to Nicolas Pearson for his implementation.

License

Released under the MIT License. Extended from kalos repository.