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

@blazefw/email

v0.1.1

Published

BlazeFW email renderer — maps Stack, Text, Action, and Input primitives to MSO-safe HTML strings with table-based layout and wrapDocument() for full Outlook-compatible email templates

Readme

@blazefw/email

BlazeFW email renderer — maps the four semantic primitives (Stack, Text, Action, Input) to MSO-safe HTML strings. Generates table-based layouts compatible with Outlook, Gmail, Apple Mail, and all major email clients. No JSX, no React — pure TypeScript string composition.

Installation

npm install @blazefw/email @blazefw/primitives

Quick start

import { Stack, Text, Action, wrapDocument } from '@blazefw/email';

const html = wrapDocument(
  Stack({ direction: 'column', gap: 4, padding: 6, background: 'surface' }, [
    Text({ variant: 'title', weight: 'bold' }, 'Welcome to BlazeFW'),
    Text({ variant: 'body', color: 'muted' }, 'You have been invited to join the team.'),
    Action({ variant: 'primary', href: 'https://app.blazefw.dev/invite/abc123' }, 'Accept Invitation'),
    Text({ variant: 'caption', color: 'muted' }, 'This link expires in 48 hours.'),
  ]),
  { previewText: 'You have a new invitation', title: 'BlazeFW Invitation' }
);

// Send `html` with any email provider (Resend, SendGrid, SES, Nodemailer, etc.)

API

Stack(props, children) — Table-based layout

Generates a <table role="presentation"> layout (CSS flexbox and grid are unsupported in Outlook).

import { Stack } from '@blazefw/email';

// Column layout (default)
const column = Stack(
  { direction: 'column', gap: 3, padding: 4, background: 'surface', radius: 'md' },
  [child1, child2, child3]
);

// Row layout — children are expected to be <td> elements
const row = Stack(
  { direction: 'row', gap: 2 },
  [cell1, cell2]
);

Layout note: gap in email is implemented as padding on each <td> — CSS gap has no email client support.

Text(props, children) — Typography

import { Text } from '@blazefw/email';

Text({ variant: 'heading', color: 'primary', align: 'center' }, 'Monthly Report')
Text({ variant: 'body' }, 'Here is a summary of activity this month.')
Text({ variant: 'caption', color: 'muted' }, 'Sent by BlazeFW notifications')
Text({ variant: 'code' }, 'npm install @blazefw/web')

Children are run through escapeHtml() automatically — safe to pass untrusted content.

Action(props, children) — Link button

Always renders as <a> (no <button> in email). Defaults to href="#" when no href is provided.

import { Action } from '@blazefw/email';

Action({ variant: 'primary', href: 'https://app.blazefw.dev/confirm' }, 'Confirm Email')
Action({ variant: 'ghost', href: 'https://app.blazefw.dev/unsubscribe' }, 'Unsubscribe')

Input(props) — Static form placeholder

Renders a visual-only form field (label + underline + error/hint text). Email clients don't support interactive <input> elements — use this to show a form preview that links to a web page.

import { Input } from '@blazefw/email';

Input({
  fieldLabel: 'New password',
  placeholder: '••••••••',
  hint: 'Minimum 8 characters',
  variant: 'underline',
})

wrapDocument(body, options?) — Full email document

Wraps your email body in a complete MSO-safe HTML document with:

  • <!DOCTYPE html> + <html lang="en"> boilerplate
  • <meta> charset, viewport, and X-UA-Compatible
  • MSO conditional comments for Outlook VML rendering
  • Preview text hidden span
  • Centering shell table for consistent rendering
import { wrapDocument } from '@blazefw/email';

const fullHtml = wrapDocument(bodyHtml, {
  previewText: 'Your invoice is ready',   // shown in inbox preview line
  title: 'Invoice #1042',                 // <title> tag
  lang: 'en',                             // <html lang="..."> (default: 'en')
  bgColor: '#f4f4f8',                     // outer background (default: #f4f4f8)
});

Sending with Resend

import { Resend } from 'resend';
import { Stack, Text, Action, wrapDocument } from '@blazefw/email';

const resend = new Resend(process.env.RESEND_API_KEY);

const html = wrapDocument(
  Stack({ direction: 'column', gap: 4, padding: 6 }, [
    Text({ variant: 'title' }, 'Reset your password'),
    Action({ variant: 'primary', href: resetUrl }, 'Reset Password'),
  ]),
  { previewText: 'Reset your BlazeFW password' }
);

await resend.emails.send({
  from: '[email protected]',
  to: user.email,
  subject: 'Reset your password',
  html,
});

Color tokens

All ColorToken values resolve to hex via the built-in DEFAULT_THEME (no CSS variables in email clients):

| Token | Default hex | |---|---| | background | #13131a | | surface | #1e1e2e | | primary | #6366f1 | | primary-fg | #ffffff | | danger | #ef4444 | | muted | #3f3f50 | | muted-fg | #a0a0b0 |