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

@selvajs/notifications

v0.2.1

Published

Message templates for Selva's outbound notifications — pure render, no transport

Readme

@selvajs/notifications

Message templates for Selva's outbound mail. Pure render: data in, OutboundMessage out. No I/O, no env, no transport.

import { renderInviteEmail } from '@selvajs/notifications';

const message = renderInviteEmail({ to, acceptUrl, orgName, expiresAt });
await getNotificationProvider().send(message, log);

Where this sits

Three pieces, deliberately kept apart:

| Piece | Owns | Lives | | -------------------------- | ----------------------------- | ------------------- | | INotificationProvider | putting a message on the wire | @selvajs/platform | | SmtpNotificationProvider | doing that over SMTP | @selvajs/server | | Templates (this package) | what the message says | here |

A template never fetches. It takes resolved values — orgName, not orgId — because a template that can fetch is a template that can fail, and mail is rendered on a path where failing is not an option.

Adding a template

Build on renderLayout rather than writing a fresh document. The wrapper owns the card chrome, type stack, and colours, so mail written by different people at different times still reads as coming from one product.

Two rules the invite template demonstrates and the tests enforce:

  • Both parts carry the payload. A mail that degrades to plain text must still contain the link. If the point of the mail is a URL, the text part needs it.
  • Everything interpolated goes through escapeHtml — including URLs. An accept URL carries a token, and a token can contain characters that close an href early.

Tag the result with its NotificationKind (declared in @selvajs/platform/notifications) so the dispatcher can route it and honour a user's per-kind preferences.

Not published

Private on purpose. Everything here is Selva's own content — templates about Selva orgs, Selva invites, Selva branding — with one consumer, the Selva app.

The extension point is already public and lives elsewhere: OutboundMessage and INotificationProvider ship in @selvajs/platform, so a self-hoster can implement a transport or hand-build a message without this package existing.

Worth revisiting. Publish this if someone outside the app needs to render Selva mail — most plausibly a self-hoster customising invite or magic-link copy rather than replacing it wholesale. Two things should settle first, because both are likely to move the exported shape:

  • notify() may change what a template receives (channel, preference metadata, resolved-vs-id inputs).
  • The magic-link template lands in the same pass and is the second data point on what a template signature wants to look like.

Publishing makes every export semver-protected, and that is a bad trade while the shape is still moving. Going private → public later is a version bump; going back is not. See plans/features/notifications.md.