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/runtime

v0.2.7

Published

HS-X Worker runtime — token service, rate limiter, completion queues, install lifecycle.

Readme

@hs-x/runtime

@hs-x/runtime is the server-side half of HS-X, the code that runs inside the Cloudflare Worker your app deploys to. Where @hs-x/sdk is the authoring surface you write your app against, @hs-x/runtime is what executes it: it takes the worker definition the SDK produces and turns it into a live fetch handler that HubSpot talks to.

Install

# already added by `hs-x init`; only needed for a hand-built project
bun add @hs-x/sdk @hs-x/runtime

App authors install this package alongside @hs-x/sdk; those are the two dependencies a scaffold lists. You rarely call it by hand. On deploy, hs-x generates a Worker entrypoint that imports your worker definition from src/workers/ and boots the runtime, roughly:

import { createRuntime } from "@hs-x/runtime";
import worker from "./src/workers/deals.js";

let runtime: ReturnType<typeof createRuntime> | undefined;

export default {
  fetch(request: Request, env: Record<string, unknown>) {
    runtime ??= createRuntime({ worker, env });
    return runtime.fetch(request);
  },
};

The real generated entrypoint additionally wires token stores, OAuth, rate limiting, and checkpointing from the Worker's environment bindings.

What it provides

createRuntime(options) is the headline export. Around it, the package covers the runtime concerns an HS-X app needs but should not have to reimplement:

| Concern | Key exports | | --- | --- | | Capability dispatch | createRuntime returns the fetch handler plus drainTriggerQueue / drainActionCompletionQueue for queue consumers | | Install tokens and OAuth | createRuntimeTokenService, createKvRuntimeOAuthStateStore, createSignedRuntimeOAuthStateStore | | HubSpot client wiring | Install-scoped, rate-limit-aware clients built on @hs-x/hubspot, including the batching Effect client | | Install lifecycle | Webhook dedup, sync cursors, revision routing, and dev overrides, each with an in-memory store for local dev (createMemoryRuntimeWebhookDedupStore and friends) | | Attestation and observability | createRuntimeAttestationHeartbeat, checkpoint recording via @hs-x/checkpoint | | Request signing | signHubSpotRequestV3, verifyHubSpotSignatureV3, and dev-proxy signing | | Feature flags | Edge evaluation and authoring handlers (createRuntimeFlagsContext, handleFlagsEvaluateRequest) |

Everything is built on Effect and is Worker-safe: no Node built-ins, no filesystem. The dev-time, Node-bound counterpart lives in @hs-x/hubspot-cli.

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; the platform is opt-in. 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