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

v0.1.0

Published

The fleet's thin Resend send primitive — one dependency-free way to send transactional mail (raw REST, runs in Node/Bun/edge), with a dev kill-switch + recipient allowlist so test sends never reach real users and a typed {ok,id?,error?} return that never

Readme

@broberg/mail

The fleet's thin Resend send primitive — one consistent, dependency-free way to send transactional mail across every @broberg/* app.

  • No SDK, no deps. Raw POST to Resend's stable REST API, so it runs in Node, Bun and edge runtimes alike — and there's no SDK version-floor to chase.
  • Never throws. Every send returns a typed { ok, id?, error?, skipped? }.
  • Ship-dark + allowlist. No API key ⇒ a logged no-op (your dev/preview flows don't crash). A non-live mailer only delivers to allowlisted recipients — the fleet admins ([email protected] …) are always reachable — so test mail never hits real users.
  • Delivery only. HTML templates stay per-app (they diverge per brand). This package is the chokepoint every repo used to duplicate.
pnpm add @broberg/mail

Usage

import { createMailerFromEnv } from "@broberg/mail";

// Reads RESEND_API_KEY, MAIL_FROM, MAIL_FROM_NAME,
//       MAIL_DISABLED, MAIL_LIVE, MAIL_ALLOWLIST (comma-separated).
const mailer = createMailerFromEnv();

const r = await mailer.send({
  to: "[email protected]",
  subject: "Booking confirmed",
  html: "<p>See you Tuesday.</p>",
  text: "See you Tuesday.",
});
// r: { ok: true, id: "…" } | { ok: false, error } | { ok: true, skipped: true }

Explicit config instead of env:

import { createMailer } from "@broberg/mail";

const mailer = createMailer({
  apiKey: process.env.RESEND_API_KEY,
  from: "[email protected]",
  fromName: "Sanne Andersen", // composes "Sanne Andersen <[email protected]>"
  live: process.env.NODE_ENV === "production",
  allowlist: ["[email protected]"], // who gets real mail when not live
});

send() passes through text, replyTo, cc, bcc, headers, tags, and attachments (byte content is base64-encoded for you; contentId enables inline cid: images).

Env vars

| Var | Purpose | |---|---| | RESEND_API_KEY | Resend key. Absent ⇒ ship-dark (logged no-op). | | MAIL_FROM | Default sender — "Name <email>" or a bare address. | | MAIL_FROM_NAME | Display name when MAIL_FROM is bare. | | MAIL_DISABLED | 1/true ⇒ hard kill-switch (every send a no-op). | | MAIL_LIVE | 1/true ⇒ deliver to anyone. Default: live when a key is set. | | MAIL_ALLOWLIST | Comma-separated recipients allowed when not live. |

API

  • createMailer(config?) → Mailer
  • createMailerFromEnv(overrides?) → Mailer
  • mailAllowed(to, { live?, allowlist? }) → boolean — the pure recipient gate.
  • buildFrom(name, address) → "name <address>"
  • ALWAYS_ALLOWED — fleet admins always reachable through the gate.

Owned + published by broberg-ai/components (epic F005). MIT.