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

@bimetal/channel

v0.35.0

Published

Generic pluggable notification-channel abstraction. Domain-agnostic send-to-recipient with a capability model and a zero-dependency template renderer. In-process default, external adapters (Webhook, Slack, Email, SMS, …) implement the same Channel interfa

Readme

@bimetal/channel

Generic pluggable notification-channel abstraction. Domain-agnostic „send-to-recipient" mit Capability-Modell + abhängigkeitsfreiem Template-Renderer. In-Process-Default; externe Adapter (Webhook, Slack, Email, SMS, …) implementieren das gleiche Interface.

Zero external dependencies. Zero @bimetal/* dependencies. Standort im Stack neben @bimetal/broker: beide sind Transport-Primitive, keine domain-spezifischen Packages.

Installation

npm install @bimetal/channel

What's Inside

Types

  • Channel<TMessage = ChannelMessage>send(recipient, message), capabilities, optional close(). Adapter hängen NUR hieran, nicht am Alerting-Kern.
  • ChannelMessage{ subject?, body, meta? }. Pre-rendert; der Channel schickt sie unverändert.
  • ChannelCapabilities{ batch, retries }. Einzige Quelle der Wahrheit für Adapter-Fähigkeiten.
  • Recipient, Template

Default-Template (zero-dep)

  • interpolate(template, data) — minimaler {{pfad}}-Renderer, prototype-sicher (Object.hasOwn). Bewusst kein Handlebars/Mustache — das verletzt „zero external deps". Eine App klinkt einen eigenen Renderer über das Template-Interface ein.
  • defaultTemplateTemplate-Implementierung über interpolate.

In-Process-Default

  • createInProcessChannel(options?) — Test-Collector mit sent() / clear(); optionaler fail-Hook simuliert Zustellfehler. Beweist die Verdrahtung ohne Netzwerk/Credentials.

Geteilter HTTP-Helfer (für die HTTP-Adapter)

  • httpSend(req, options?) — POST über das fetch-Global; fetch ist injizierbar (HttpSendOptions.fetch), also unit-testbar ohne Netzwerk. Per-Request-Timeout via AbortController (timeoutMs, Default 10s) — ein hängender Provider blockiert nie den Orchestrator-Tick.
  • ChannelHttpError — Zustellfehler mit HTTP-Status. .message ist body-frei (HTTP <status>) — sicher zum Persistieren in einem Event-Log; der gekappte Provider-Body liegt nur auf .detail (transiente Diagnose). Hält Credential-/PII-Echos aus unveränderlichen Logs heraus.

Designprinzipien

  • Generic over TMessage: kein DomainEvent-/Alert-Lock-in. Der Channel kennt weder Event-Sourcing noch Kalender.
  • Capabilities zuerst: Adapter-Unterschiede (batch, retries) werden explizit kommuniziert, nicht durch An-/Abwesenheit von Methoden.
  • Body-freie Fehler: ein non-2xx wirft ChannelHttpError mit body-freier message — die Security-Eigenschaft, auf der der Alerting-Fehlervertrag aufsetzt.
  • Zero-dep Template: der Default-Renderer ist absichtlich minimal; mächtigere Engines sind App-Sache über das Interface.

License

Apache License 2.0