Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zcong1993/node-grpc-health-check
Health check client and service for use with @grpc/grpc-js.
https://github.com/zcong1993/node-grpc-health-check
grpc grpc-health grpc-js grpc-node
Last synced: 1 day ago
JSON representation
Health check client and service for use with @grpc/grpc-js.
- Host: GitHub
- URL: https://github.com/zcong1993/node-grpc-health-check
- Owner: zcong1993
- License: mit
- Created: 2021-09-22T08:17:50.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-09T10:31:56.000Z (30 days ago)
- Last Synced: 2024-10-20T23:27:53.739Z (18 days ago)
- Topics: grpc, grpc-health, grpc-js, grpc-node
- Language: TypeScript
- Homepage:
- Size: 187 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# node-grpc-health-check
[![NPM version](https://img.shields.io/npm/v/@zcong/node-grpc-health-check.svg?style=flat)](https://npmjs.com/package/@zcong/node-grpc-health-check)
[![NPM downloads](https://img.shields.io/npm/dm/@zcong/node-grpc-health-check.svg?style=flat)](https://npmjs.com/package/@zcong/node-grpc-health-check)
[![codecov](https://codecov.io/gh/zcong1993/node-grpc-health-check/branch/master/graph/badge.svg)](https://codecov.io/gh/zcong1993/node-grpc-health-check)
[![JS Test](https://github.com/zcong1993/node-grpc-health-check/actions/workflows/js-test.yml/badge.svg)](https://github.com/zcong1993/node-grpc-health-check/actions/workflows/js-test.yml)> Health check client and service for use with [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js).
## Background
This package exports both a client and server that adhere to the [gRPC Health Checking Protocol](https://github.com/grpc/grpc/blob/master/doc/health-checking.md).
### Why not [grpc-health-check](https://github.com/grpc/grpc-node/tree/master/packages/grpc-health-check)
- `grpc-health-check` is for deprecated native [grpc](https://github.com/grpc/grpc-node/tree/master/packages/grpc-native-core) package not for [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js)
- `grpc-health-check` implements an expired protocol of `gRPC Health Checking Protocol` not the latest version## Features
- 100% Typescript
- implements the latest version of `gRPC Health Checking Protocol`
- API is similar to `grpc-health-check`
- support `shutdown` and `resume` method like `grpc-go`## Install
```bash
$ yarn add @zcong/node-grpc-health-check
# or npm
$ npm i @zcong/node-grpc-health-check --save
```## Usage
### Server
```ts
import { HealthImplementation, service, ServingStatus } from '../src'const server = new grpc.Server()
const h = new HealthImplementation({
'': ServingStatus.NOT_SERVING,
test1: ServingStatus.SERVING,
})
server.addService(service, h)
```### Client
Any gRPC-node client can use `@zcong/node-grpc-health-check` to run health checks against other servers that follow the protocol.
Full examples can be viewed at [./example](./example).
## License
MIT © zcong1993