npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@healthzkit/cockroach

v0.0.3

Published

CockroachDB health-check adapter for healthzkit via the PostgreSQL wire protocol (pg).

Downloads

29

Readme

@healthzkit/cockroach

CockroachDB healthzkit HealthAdapter helper for pg (node-postgres). CockroachDB speaks the PostgreSQL wire protocol, so the adapter runs a lightweight SQL probe (default SELECT 1) via client.query. Successful checks return ok with metadata.latencyMs plus any fields from an optional metadata hook; failures return fail with the caught error.

Install

npm install @healthzkit/cockroach healthzkit pg

Peer: pg ≥ 8.

Options

cockroachPgAdapter accepts BaseCockroachOptions:

| Option | Description | | ---------- | ---------------------------------------------------------------------------------------------------------------------------------- | | query | SQL executed for the probe. Default SELECT 1. | | metadata | Optional async (client) => Record<string, unknown> merged into check metadata with latencyMs. | | pgOption | Optional pg Pool constructor options (except connectionString). Only with connectionString. Merged into the internal pool. |

Pass either connectionString or client (not both).

Connection string

The adapter maintains an internal Pool with max: 1, connect()s a client for each check, runs client.query(query), then release()s the client in a finally block.

import { createHealthKit } from "healthzkit";
import { cockroachPgAdapter } from "@healthzkit/cockroach";

const kit = createHealthKit({
  checks: [
    {
      name: "cockroach",
      type: ["readiness"],
      adapter: cockroachPgAdapter({
        connectionString: process.env.DATABASE_URL!,
      }),
    },
  ],
});

Optional pgOption merges into the internal Pool constructor (everything except connectionString).

Existing client or pool

Pass client as:

  • A Pool: each check calls pool.connect(), runs the query on the PoolClient, then releases it.
  • A PoolClient or other ClientBase: the query runs on that instance; release is a no-op.
import { Pool } from "pg";
import { cockroachPgAdapter } from "@healthzkit/cockroach";

const pool = new Pool({ connectionString: process.env.DATABASE_URL! });

const adapter = cockroachPgAdapter({
  client: pool,
  query: "SELECT current_database()",
});

Scheduling

For busy clusters, pair this adapter with a schedule on the check so readiness reads cached results instead of hitting CockroachDB on every probe. See the Scheduling section in the healthzkit README.

Development

From the monorepo root:

vp install
vp test --filter @healthzkit/cockroach
vp pack --filter @healthzkit/cockroach