medicus
v1.5.0
Published
Flexible, framework-agnostic health check library for Node.js and TypeScript. Liveness and readiness checks with Fastify, Hono, Avvio and plain HTTP integrations.
Maintainers
Readme
Medicus
Flexible and agnostic health checks. Ensure the post-deployment health of your services.
Medicus is a comprehensive, agnostic health check library for Node.js. It provides an easy way to monitor the health of various services and integrates seamlessly with Fastify.
import { Medicus, HealthStatus } from 'medicus';
const medicus = new Medicus();
// Add health checkers
medicus.addChecker({
database() {
// Custom health logic
return HealthStatus.HEALTHY;
},
async cache() {
// Simulate an unhealthy status
return HealthStatus.UNHEALTHY;
}
});
// Perform a health check
const result = await medicus.performCheck(true);
// {
// status: 'UNHEALTHY',
// services: {
// database: { status: 'HEALTHY' },
// cache: { status: 'UNHEALTHY' }
// }
// }License
Licensed under the MIT. See LICENSE for more information.
