Overview & Quick Start
Bun Runtime Health Integration
@nexload-sdk/healthcheck-bun
v2.1.0 Stable ReleasedBun runtime adapter and Bun server metrics for @nexload-sdk/healthcheck.
Bun
@nexload-sdk/healthcheck-bun connects @nexload-sdk/healthcheck to the Bun JavaScript runtime and Bun.serve() HTTP server metrics.
10-Second Code Snippet
Section titled “10-Second Code Snippet”import { createHealthManager, shutdownCheck } from "@nexload-sdk/healthcheck";import { bunRuntimeAdapter, bunServerMetricsCheck } from "@nexload-sdk/healthcheck-bun";
const server = Bun.serve({ fetch: (req) => { if (new URL(req.url).pathname === "/health") { return health.run("readiness").then((r) => Response.json(r)); } return new Response("OK"); },});
export const health = createHealthManager({ service: { name: "bun-service" }, runtime: bunRuntimeAdapter(), checks: [shutdownCheck(), bunServerMetricsCheck(server)],});What You Get
Section titled “What You Get”- Native Bun Runtime Adapter: Queries JavaScriptCore heap statistics, Bun process uptime, and platform architecture.
Bun.serve()Server Metrics: Observes pending requests and active WebSocket connections directly from the native Bun server handle.- Zero Node Dependencies: Implemented cleanly against Bun global APIs without unnecessary Node.js polyfills.
Installation & Requirements
Section titled “Installation & Requirements”bun add @nexload-sdk/healthcheck-bun @nexload-sdk/healthcheckRequires Bun >=1.0.0.
Next Steps
Section titled “Next Steps”- Explore Production Guides & Server Recipes for Bun HTTP servers, WebSocket counters, and troubleshooting.
- Check the API Reference & Signatures for all exported checks and adapters.