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

@frontierjs/email-kit

v0.1.9

Published

Mesa email component kit — table-based email components with CSS inlining for transactional email

Readme

@frontierjs/email-kit

Email component kit for Mesa. Table-based, CSS-inlined, Outlook-safe.

Replaces MJML for transactional email built with the Frontier ecosystem.

Install

bun add @frontierjs/email-kit @frontierjs/mesa happy-dom css-tree

Usage

In a Mesa template

<script module>
  // <script module> runs once, outside any instance — a subject naming the
  // recipient is a function of the data, applied by the caller
  export const subject = (d) => `Welcome, ${d.firstName}!`
</script>

<script>
  import Email    from '@frontierjs/email-kit/components/Email.mesa'
  import Section  from '@frontierjs/email-kit/components/Section.mesa'
  import Row      from '@frontierjs/email-kit/components/Row.mesa'
  import Column   from '@frontierjs/email-kit/components/Column.mesa'
  import Button   from '@frontierjs/email-kit/components/Button.mesa'
  import Card     from '@frontierjs/email-kit/components/Card.mesa'
  import KeyValue from '@frontierjs/email-kit/components/KeyValue.mesa'
  import Footer   from '@frontierjs/email-kit/components/Footer.mesa'

  export let firstName = 'Friend'
  export let planName  = 'Pro'
  export let amount    = '$49.00'
</script>

<Email preview="Your account is ready.">
  <Section bgcolor="#9fc612">
    <Row>
      <Column align="center" padding="32px 16px">
        <h1 style="color:#fff;font-family:Helvetica,Arial,sans-serif;">
          Welcome, {firstName}!
        </h1>
      </Column>
    </Row>
  </Section>

  <Section>
    <Row>
      <Column>
        <Card heading="Your Plan">
          <KeyValue label="Plan"   value="{planName}" />
          <KeyValue label="Amount" value="{amount}" bold={true} />
        </Card>
      </Column>
    </Row>
    <Button href="https://app.example.com" text="Go to Dashboard" />
  </Section>

  <Section bgcolor="#f4f4f4">
    <Footer
      company="Example Inc."
      unsubscribe="https://example.com/unsubscribe"
    />
  </Section>
</Email>

Server-side rendering

import { renderEmailFile } from '@frontierjs/email-kit/render'

const data   = { firstName: 'Alice', planName: 'Pro', amount: '$49.00' }
const result = await renderEmailFile('./emails/WelcomeEmail.mesa', { data })

// result.html     — complete <!DOCTYPE html> with all CSS inlined
// result.text     — plain-text fallback
// result.subject  — export const subject from <script module>, exactly as exported
// result.css      — collected CSS (pre-inlining, for debugging)

// Send via your email provider:
await sendgrid.send({
  to:      '[email protected]',
  from:    '[email protected]',
  subject: typeof result.subject === 'function' ? result.subject(data) : result.subject,
  html:    result.html,
  text:    result.text,
})

Components

Layout

| Component | Description | |-----------|-------------| | Email | Full email document wrapper with preheader support | | Section | Full-width table section | | Row | Single <tr> row | | TwoCol | Responsive two-column layout (stacks on mobile) | | Column | <td> cell | | Spacer | Vertical whitespace row |

Heading, Text, KeyValue, Image and DataTable render a <tr>, so they go directly in a Section or a Card. Inside a Column (a <td>) the parser moves the row out of the cell and the layout runs full width; the kit warns once when it sees that. Wrap them in a Card there, as the example above does.

Content

| Component | Description | |------------|-------------| | Heading | Accent heading row | | Text | Paragraph with email-safe typography | | Button | CTA with Outlook VML fallback | | Image | Responsive image with fluid class | | Link | Inline anchor | | Divider | Table-cell horizontal rule |

Blocks

| Component | Description | |-------------|-------------| | Card | Bordered card with optional heading | | KeyValue | Label/value pair row — the workhorse for data display | | DataTable | Structured table with header row | | Review | Testimonial block with avatar, stars, body | | Stars | Inline SVG star rating (no external image) | | Avatar | Inline SVG letter circle |

Structural

| Component | Description | |-----------|-------------| | Header | Logo/brand header row | | Footer | Legal/unsubscribe footer | | Contact | Name, email, phone, URL block | | Address | Formatted address with Google Maps link |

Templates

Starter templates live in ./templates/:

  • WelcomeEmail.mesa — onboarding/welcome email with hero, plan summary, testimonial

How it works

Templates are standard Mesa components. renderEmailFile / renderEmail calls @frontierjs/mesa's renderComponent pipeline with target: 'email':

  1. Recursively compiles all .mesa imports
  2. Executes components in a happy-dom virtual DOM
  3. Collects all <style> block CSS across the tree
  4. Inlines CSS into style="" attributes (CSS variables resolved, @media preserved in <head>)
  5. Wraps in a complete <!DOCTYPE html> document with MSO/VML namespaces

Email client compatibility

Nothing here has been opened in a real mail client. Every claim below is a claim about the HTML this package emits, verified by reading the output — not a claim about what Outlook or Gmail does with it. The techniques are the standard ones and the markup is shaped for them; whether they land is untested, and saying otherwise would be the one thing an email kit must not get wrong.

What the output actually carries:

  • Outlook — VML bulletproof buttons, MSO conditional comments, table layout. The conditional-comment handling is fragile and docs/ is the only record of why the markup is shaped the way it is — read it before touching it
  • Gmail — styles inlined onto style="", no <style> block in the body
  • Apple Mail — @media blocks preserved in <head> for responsive rules
  • Mobile — two-column layouts declare @media (max-width: 600px) to stack

Proving it needs a real send to a matrix of clients, which this package has no harness for. Until it does, treat the list as intent.