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

@openuidev/observability

v0.0.3

Published

Framework-free observability event bus for OpenUI: emit and listen to events

Readme

@openuidev/observability

Framework-agnostic observability event bus for OpenUI. Emit and listen to events at a level (info / warning / error), each carrying a typed detail payload. Zero dependencies, safe on server and browser. A single shared instance per app.

Usage

import { observability, toErrorInfo } from "@openuidev/observability";

// Listen to a level — every event at that level.
const remove = observability.listen("error", (event) => {
  console.error(event.detail);
});
remove();

// Or several levels at once.
observability.listen(["warning", "error"], (event) => report(event));

// Listen to everything — the attachment point for sinks (Sentry, Datadog, ...).
const detach = observability.listenAll((event) => {
  if (event.level === "error") {
    // forward event.detail to your service
  }
});

Emitting

The instance is itself callableobservability(level, detail) — with level shortcuts hanging off it, like a toast library:

// Call the bus with an explicit level and a payload.
observability("error", { kind: "renderer:error", component: "Chart", error: toErrorInfo(err) });

// Level shortcuts (like toast.error / toast.warning / toast.info):
observability.error({ kind: "llm:timeout", requestId, message: "timed out" });
observability.warn({ kind: "chart:overflow", component: "Chart", points: 1200 });
observability.info({ kind: "route:change", to: "/settings" });

// Reuse an id when publishing successive snapshots of one logical event.
observability.info({ id: streamId, kind: "llm:stream", response });

The event envelope

Every listener receives the same envelope:

interface ObservabilityEvent {
  level: "info" | "warning" | "error";
  timestamp: number; // ms since epoch
  detail: ObservabilityDetail;
}

The detail

detail is a typed shape, not free-form: a required kind descriptor plus optional message / error, and any extra fields you need.

interface ObservabilityDetail {
  id?: string; //                    stable identity shared by successive snapshots
  kind: string; //                  required descriptor, e.g. "fetch:error"
  message?: string; //              optional human-readable message
  error?: ObservabilityErrorInfo; // present on failures; build with toErrorInfo()
  [key: string]: unknown; //        extra structured fields — ids, timings, urls
}

Build the error field from any thrown value with toErrorInfo(value):

interface ObservabilityErrorInfo {
  name?: string; // e.g. "TypeError"
  message: string;
  stack?: string;
  cause?: unknown; // the original thrown value
}