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

@broberg/notify

v0.1.0

Published

Dark-ship team-chat webhook notifications for the broberg.ai fleet — createNotifier({ discord, slack }).send(msg) fans one message out to every configured incoming-webhook channel. Chat only (email → @broberg/mail, browser push → @broberg/webpush). Zero r

Downloads

99

Readme

@broberg/notify

Dark-ship team-chat webhook notifications for the broberg.ai fleet. One message shape, fanned out to every configured incoming-webhook channel (Discord + Slack today), with a per-channel delivery result.

npm i @broberg/notify

Usage

import { createNotifier } from "@broberg/notify";

const notify = createNotifier({
  discord: { webhookUrl: process.env.DISCORD_WEBHOOK },   // a channel with no URL is skipped (dark-ship)
  slack:   { webhookUrl: process.env.SLACK_WEBHOOK },
});

const results = await notify.send({
  title: "Klar til gennemsyn",
  text: "📸 Dit ContentPush-opslag er klar",
  url: "https://contentpush.example/review/42",
});
// → posts to every configured channel
// results → [{ channel: "discord", ok: true, status: 204 }, { channel: "slack", ok: true, status: 200 }]

Dark-ship

A channel is registered only if its webhookUrl is present. An unset env var ("") means that channel is silently skipped — no crash, no half-wired surface in prod. A notifier with zero configured channels is inert: send() is a no-op that returns [] and never throws. Same posture as @broberg/mail / @broberg/auth.

createNotifier({}).channels;                       // []
await createNotifier({}).send({ text: "hi" });     // [] — nothing sent, no throw
createNotifier({ discord: { webhookUrl: "" } }).channels; // [] — empty URL = dark-shipped

Per-channel isolation

send() posts to all channels concurrently and returns one ChannelResult per channel. A network error or non-2xx on one channel never sinks the others:

// discord webhook is down, slack is fine:
// → [{ channel: "discord", ok: false, error: "fetch failed" },
//    { channel: "slack",   ok: true,  status: 200 }]

Scope — chat channels only

@broberg/notify is deliberately fenced to team-chat channels reached by an incoming webhook. It is not a universal notifier:

| You want to… | Use | | --- | --- | | Post to a Discord / Slack channel | @broberg/notify | | Send an email | @broberg/mail | | Send a browser / PWA push | @broberg/webpush |

Keeping the three non-overlapping is the point — notify never grows an email or push transport. Later chat channels (Teams, Telegram, Mattermost — all the same webhook-POST shape) are additive.

Message mapping

One NotifyMessage maps to each channel's native payload:

| Field | Discord (content) | Slack (text) | | --- | --- | --- | | title | **bold** line | *bold* line | | text | body line | body line | | url | trailing line | trailing line |

Present fields are joined with newlines; absent ones are dropped.

API

interface NotifyMessage { text: string; title?: string; url?: string; }
type ChannelName = "discord" | "slack";
interface ChannelResult { channel: ChannelName; ok: boolean; status?: number; error?: string; }
interface NotifierConfig { discord?: { webhookUrl: string }; slack?: { webhookUrl: string }; }
interface Notifier { send(msg: NotifyMessage): Promise<ChannelResult[]>; channels: ChannelName[]; }

function createNotifier(config: NotifierConfig): Notifier;

Runtime deps: none (global fetch). Webhook URLs are secrets — read them from env, never hardcode. MIT · part of the @broberg/* shared-library family.