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

@hs-x/checkpoint

v0.2.7

Published

HS-X Checkpoint observability primitives — metrics, exemplars, fingerprinting, and redaction.

Readme

@hs-x/checkpoint

@hs-x/checkpoint is HS-X's observability primitive layer — how a deployed app records what each capability invocation did (its outcome, duration, and an error fingerprint) without leaking sensitive values. It defines fingerprinting, redaction, exemplar sampling policy, fake/in-memory writers for tests, and the Cloudflare binding writers that persist the data, all against the canonical schemas in @hs-x/types.

You normally do not install this directly. It is a transitive dependency of @hs-x/runtime, which calls it for you when you enable checkpointing in createRuntime(...). A fake-writer surface for tests is published at the @hs-x/checkpoint/test subpath.

# only for standalone tooling against the checkpoint contracts
bun add @hs-x/checkpoint

Recording an invocation

recordCheckpointInvocation(...) (and its Effect form, recordCheckpointInvocationEffect(...)) emits a metric event plus, when the exemplar policy selects it, a redacted exemplar to the configured CheckpointWriter. fingerprintError(...) produces the stable error fingerprint used to group failures; redactCheckpointValue(...) strips sensitive fields before anything is stored. The sampling/budget rules come from createExemplarPolicy(...).

Cloudflare writer

createCloudflareCheckpointWriter() composes the runtime write targets behind the stable CheckpointWriter contract:

  • Analytics Engine receives every CheckpointMetricEvent.
  • D1 receives sampled or budgeted CheckpointRunExemplar rows in checkpoint_exemplars by default.
  • Queue receives metric and exemplar envelopes for async fanout.
  • R2 receives error exemplars by default, with optional success exemplar archival.

The D1 table name is configurable but must already exist. The default migration is published at migrations/0001_checkpoint_exemplars.sql and creates:

CREATE TABLE checkpoint_exemplars (
  exemplar_id TEXT PRIMARY KEY,
  account_id TEXT NOT NULL,
  hsx_account_id TEXT NOT NULL,
  project_id TEXT NOT NULL,
  deploy_id TEXT NOT NULL,
  worker_name TEXT NOT NULL,
  capability_id TEXT NOT NULL,
  portal_id TEXT NOT NULL,
  outcome TEXT NOT NULL,
  observed_at TEXT NOT NULL,
  duration_ms REAL NOT NULL,
  fingerprint TEXT,
  value_json TEXT NOT NULL
);

listD1CheckpointExemplars() reads those D1 rows back through the same shared schema with optional project, deploy, outcome, fingerprint, and limit filters.

Part of HS-X

HS-X is a leaveable, type-safe HubSpot app framework on Cloudflare Workers. Deployed apps run in your own Cloudflare account, and the checkpoint data this package writes lands in your own Analytics Engine, D1, and R2, not in HS-X's. Start with the CLI:

npm i -g @hs-x/cli
hs-x init myapp

See @hs-x/cli and the docs at hs-x.dev/docs.

License

Apache-2.0