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

@openknot-ts/sentry-bun

v0.0.6-preview

Published

Reports OpenKnot failures to Sentry through the Bun SDK, with its lifecycle.

Readme

OpenKnot Sentry for Bun

@openknot-ts/sentry-bun reports the application's failures to Sentry through @sentry/bun. It implements the error reporting contract: each reported failure becomes a Sentry issue tagged with openknot.source, with the report's attributes, such as the message id, as its openknot context. The Node runtime uses @openknot-ts/sentry-node.

Usage

The module owns the SDK, with options from validated config:

import { provideSentry } from "@openknot-ts/sentry-bun";
import { config } from "@openknot-ts/wire";
import { z } from "zod";

const settings = config({ SENTRY_DSN: z.url(), SENTRY_ENVIRONMENT: z.string() });

const errors = provideSentry({
  requirements: { settings },
  options: ({ settings }) => ({ dsn: settings.SENTRY_DSN, environment: settings.SENTRY_ENVIRONMENT }),
  errors: [PaymentDeclined],
});

// defineApplication({ modules: [applicationModule, errors] })

The module calls Sentry.init() at startup and closes its client at shutdown, after the application's work has drained, so pending events are sent. It waits as long as the native shutdownTimeout option, two seconds by default.

The SDK keeps one client per process, so one application owns it: startup fails when Sentry is already initialized, by another Sentry.init() or another application's module. Shutdown closes only the module's own client and releases the process's Sentry for a later application. The application does not call Sentry.init() itself, so Sentry's own instrumentation, which needs initializing before anything else is imported, is not part of this module.

API

| Export | Description | | --- | --- | | provideSentry({ requirements?, options, errors? }) | Owns the SDK and provides the error reporter as a module. | | SentryModule, SentryModuleOptions | Types. |

  • options(dependencies) returns the SDK's own options, every native option included.
  • errors is a list, or a function of the requirements, of the expected failures to report as well: an error() factory or any { is(error) }. Unexpected failures are always reported.
  • Startup fails when its requirements are not registered, so a missing setting never silently disables reporting.
  • Unexpected failures reach Sentry as unhandled (mechanism.handled: false), expected ones as handled.

Link issues to traces

Flow reports a failed execution while its span is still active, and cache and replication report inside the spans of their failures. With OpenTelemetry tracing selected, Sentry links each issue to that span once its OpenTelemetry integration reads the application's pipeline:

options: ({ settings }) => ({
  dsn: settings.SENTRY_DSN,
  enableOpenTelemetrySetup: false,
  integrations: [Sentry.openTelemetryIntegration()],
}),

Register the OpenTelemetry provider before Sentry starts. The two modules stay independent: they meet only through the active OpenTelemetry context.