Introduction
Healthzkit is a small, framework-agnostic library for liveness and readiness probes in Node.js and similar runtimes.
You define checks as adapters that return a simple status (ok, degraded, or fail). Healthzkit runs the relevant checks in parallel, rolls up an overall status, maps that to an HTTP status code and JSON or plain-text body, and can schedule checks in the background so probes read cached results instead of hitting databases or third parties on every request.
When to use it
Use healthzkit when you want:
- One place to define health checks and wire them to
/liveand/ready(or your own base path). - Consistent JSON or text payloads for operators and orchestrators.
- Optional background refresh for slow dependencies without blocking probe latency.
Install
The package is ESM-only ("type": "module"). The published entry is healthzkit → ./dist/index.mjs.
bash
pnpm add healthzkit
# or
npm install healthzkitNext steps
- Getting started — create a kit, attach checks, handle HTTP.
- Checks and adapters — configuration, timeouts, and failure mapping.
- Scheduling — cached results and lifecycle (
start/stop). - Framework guides — Elysia, Express, Hono, Next.js, and Node HTTP wiring patterns.
- Responses and HTTP — rollup rules, status codes, output format, and public types.
Optional adapters
Official adapter packages cover queues, databases, storage, search, and HTTP endpoints today.
Queues
- RabbitMQ —
@healthzkit/rabbitmq(amqplib,amqp-connection-manager). - Kafka —
@healthzkit/kafka(kafkajs,node-rdkafka).
Databases
- Redis —
@healthzkit/redis(ioredis,node-redis, Upstash). - Valkey —
@healthzkit/valkey(iovalkey,@valkey/valkey-glide). - Postgres —
@healthzkit/postgres(pg,postgres). - CockroachDB —
@healthzkit/cockroach(pg). - MySQL —
@healthzkit/mysql(mysql,mysql2). - MongoDB —
@healthzkit/mongo(mongodb,mongoose). - SQLite —
@healthzkit/sqlite(better-sqlite3,sqlite3,@libsql/client). - DynamoDB —
@healthzkit/dynamo(aws-sdk,@aws-sdk/client-dynamodb). - Drizzle ORM —
@healthzkit/drizzle(drizzle-orm; pass your existingdbinstance). - Prisma —
@healthzkit/prisma(@prisma/client; pass your existingPrismaClient). - Elasticsearch —
@healthzkit/elasticsearch(@elastic/elasticsearch).
Storage
HTTP
- HTTP endpoints —
@healthzkit/http(globalfetch; Node.js 18+).