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

@nage-api/notify

v1.0.0-beta.4

Published

Notifications for @nage-api — channel abstraction and templates

Readme

@nage-api/notify

Channel-abstracted notifications with templates (PLAN.md §8, §25 P2).

The application says "tell this user their order shipped"; whether that becomes an email, an SMS, a push, or all three is configuration and per-recipient preference, not a branch in domain code.

import { NotifyService } from '@nage-api/notify';

// Exported by `NageNotifyModule.forRoot`, so injecting the class is enough.
declare const notify: NotifyService;
declare const user: { id: string; email: string; name: string };
declare const order: { reference: string };

const report = await notify.send({
  template: 'order.shipped',
  to: { id: user.id, email: user.email, locale: 'fr-CA' },
  data: { user, order },
});
// → { template: 'order.shipped', results: [ … ], delivered: true, skipped: ['sms'] }

Three properties, in order of importance

Preferences are consulted first. A recipient who opted out of marketing SMS must not get one because a new code path forgot to check, so the check lives in the service rather than at every call site. Opt-outs can be per channel or per channel-and-template.

One channel failing does not fail the rest. A dead SMS provider should not stop the email, so channels are attempted independently and every outcome is reported.

A failure never carries the body. A notification body holds whatever the template put in it — a name, an address, an order — and error paths end up in logs that live far longer than the message did.

Templates have no expression language

{{ user.name }} interpolates a value. That is the entire grammar: no {{#if}}, no method calls, no property access that reaches a prototype. The moment a template can evaluate an expression, a template stored in a database becomes remote code execution — and "let marketing edit the emails" is a feature every product eventually ships. {{ constructor.name }} and {{ __proto__.x }} render as empty strings.

Anything the grammar cannot express belongs in the code that builds the data.

Locale selection falls back exact → language → default, and interpolated values are HTML-escaped in the html body only.

Channels

MemoryChannel records instead of sending, so a developer can exercise a signup flow without an SMTP account and a test can assert on the message that would have gone out. Like the queue's memory driver, it is refused in production — it would silently swallow every message.

Not yet implemented

  • Real channels. @nage-api/integrations-email and @nage-api/integrations-sms are where they belong; NotificationChannel is the port they implement.
  • Template loading from notify.templateDirectory; templates are registered in code today.
  • notify.from. It is declared in NotifyConfig and this package never reads it, so the sender address belongs to whichever channel you supply.
  • Retries. send reports a channel's failure and returns; nothing re-attempts it. Retrying is @nage-api/queue's job, from a job that calls send.
  • Digest/batching, and delivery-receipt tracking.