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

@emailens/cli

v0.6.0

Published

CLI tool for email compatibility analysis: lint, preview and export HTML, MJML, Maizzle and React Email rendering across 21 email clients.

Downloads

2,543

Readme

The rendering linter for email, in your terminal

CI npm MCP GitHub stars

CLI tool for email compatibility analysis; preview how your emails render across 21 email clients (Gmail, Outlook, Apple Mail, Yahoo, Samsung, Thunderbird, HEY, Proton Mail, AOL, Fastmail, Superhuman).

Point it at HTML, MJML, Maizzle or React Email. The format is detected from the file extension, the template is compiled with your project's own compiler, and what gets linted is the HTML your readers actually receive.

Across the 255 CSS and HTML features we track, only 6 are fully supported in every major client (see the data). This tool catches the other 249 before your users do.

emailens lint output showing errors and warnings across email clients

Prefer AI? Use the MCP server; same engine, works with Claude, Cursor, and any MCP client.

Install

npm install -g @emailens/cli

Or use with npx:

npx @emailens/cli analyze email.html

Commands

emailens analyze <file>

Analyze CSS compatibility and get per-client scores.

emailens analyze email.html
emailens analyze email.html --clients gmail-web,outlook-windows
emailens analyze email.html --json
cat email.html | emailens analyze -

Warnings show where the property is used, and how many other places share the problem:

  ⚠ Outlook (New) (1 issue)
    ⚠ border-radius (4:8 +2 more): Outlook (New) does not support "border-radius".

--json carries the full loc / locs for each warning. As with lint, positions are reported for HTML input only, see below.

emailens preview <file>

Full preview pipeline: transforms, analysis, dark mode simulation, and optional screenshots.

emailens preview email.html
emailens preview email.html --dark-mode
emailens preview email.html --screenshots --out ./screenshots
emailens preview email.html --json

emailens export <file>

Export a self-contained HTML or JSON report.

emailens export email.html -o ./report
emailens export email.html --json -o ./report
emailens export email.html --dark-mode --screenshots -o ./report

emailens fix <file>

Generate AI-powered fixes for email compatibility issues. Uses @emailens/engine analysis to build a structured prompt, then calls Claude to fix structural issues (table layouts, VML, MSO conditionals) that static snippets can't handle.

Requires ANTHROPIC_API_KEY environment variable and the optional @anthropic-ai/sdk dependency.

emailens fix email.html                           # Fix and print to stdout
emailens fix email.html -o fixed.html             # Write to file
emailens fix email.html --estimate                 # Show token estimate only (no AI call)
emailens fix email.html --clients outlook-windows  # Scope to one client
emailens fix email.html --json                     # Full JSON output with metadata
emailens fix email.html --max-tokens 8000          # Limit prompt size
cat email.html | emailens fix - --format jsx       # Pipe from stdin

| Flag | Alias | Description | |------|-------|-------------| | --format | -f | Input format: html, jsx, mjml, maizzle | | --clients | -c | Comma-separated client IDs to scope the fix | | --output | -o | Write fixed code to file instead of stdout | | --json | | Output as JSON (includes token estimates and metadata) | | --quiet | -q | Suppress spinners and decorations | | --estimate | | Only show token estimate without calling the AI | | --max-tokens | | Maximum input tokens for the prompt (default: 16000) |

emailens lint <file|glob>

CI/CD-friendly linting with structured exit codes. Flattens all audit checks (compatibility, content hygiene, links, accessibility, images, inbox preview, size, template variables, content overflow, visual bugs, dark-mode and mobile contrast, design consistency) into a unified issue list.

emailens lint email.html
emailens lint src/*.html
emailens lint email.html --json
emailens lint email.html --fail-on-warning
emailens lint email.html --skip spam,links
emailens lint email.html --max-warnings 5

| Flag | Alias | Description | |------|-------|-------------| | --format | -f | Input format: html, jsx, mjml, maizzle | | --json | | Output as JSON | | --fail-on-warning | | Exit 2 if warnings found | | --skip | | Comma-separated checks to skip: spam,links,accessibility,images,compatibility,inboxPreview,size,templateVariables,overflow,visual,darkContrast,mobileContrast,design | | --max-warnings | | Fail if more than n warnings |

Exit codes:

  • 0: clean
  • 1: errors found
  • 2: warnings only (with --fail-on-warning or --max-warnings exceeded)

Output format:

src/emails/welcome.html
  error  12:8  outlook-windows     border-radius           Not supported in Outlook Windows
  warn         spam                caps-ratio              20%+ of words are ALL CAPS

src/emails/newsletter.html
  pass   No issues found

2 files | 1 error | 1 warning

Issues that belong to a specific place in the file carry a line:col; findings about the document as a whole (spam signals, Gmail clipping, inbox preview) have no position and leave the column blank. With --json, each issue carries a loc object instead (line, column, endLine, endColumn, offset, length) for editors, annotations, and agents that need to point at or edit the exact source.

One property can break in many places, so CSS issues also carry locs: every occurrence in document order, with loc as the first, and locsTruncated: true when there were more than 100.

Positions are reported for HTML sources only. JSX, MJML and Maizzle are compiled before analysis, so a line number would refer to generated output rather than the file you wrote; the CLI omits it rather than print one that looks authoritative and isn't.

CI / GitHub Actions

Drop this into .github/workflows/email-lint.yml to fail PRs that introduce broken email CSS, spam triggers, or accessibility regressions:

name: Email lint

on:
  pull_request:
    paths:
      - 'emails/**'
      - 'src/emails/**'

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - name: Lint emails
        run: npx -y @emailens/cli lint 'emails/**/*.{html,tsx,mjml}' --fail-on-warning

For React Email / MJML / Maizzle source files, the CLI auto-detects the format from the extension. Want full preview reports (with screenshots and shareable links) on every PR? Use the Emailens GitHub Action instead; it wraps the same engine.

.emailensrc

The project file the VS Code extension already reads, so the editor and CI agree about what matters. Put it at the repo root, or use an emailens key in package.json:

{
  "skip": ["spam"],
  "rules": {
    "border-radius": "error",
    "font-size": "off"
  }
}

rules sets the severity of one rule, keyed by the code lint prints: a CSS property (border-radius) or a rule id (insecure-link). off drops it entirely. Promoting a rule to error makes it exit 1, which is the point: without this the only control is --skip, and a team that cares about one Outlook property has to keep the whole compatibility check at warning level.

A rule demoted in the editor that still fails the build is the worst of both worlds, and this is the file that stops that happening.

Precedence. A command-line flag wins over the file; it is an explicit choice for one invocation. In the editor it is the other way round: the repo's file wins over personal settings, because those are ambient and the file is the team's.

A malformed file is linted without rather than fatal. A severity that is not one of error, warning, info, off is named on stderr and ignored, so a typo cannot quietly leave a rule on that you believe is off. Warnings go to stderr, so lint --json | jq stays parseable.

emailens clients

List all 21 supported email clients.

emailens clients
emailens clients --json

Options

All file-processing commands share:

| Flag | Alias | Description | |------|-------|-------------| | --format | -f | Input format: html, jsx, mjml, maizzle | | --clients | -c | Comma-separated client IDs to filter | | --json | | Output JSON instead of terminal table | | --quiet | -q | Suppress spinners and decorations |

Preview and export add:

| Flag | Alias | Description | |------|-------|-------------| | --dark-mode | -d | Include dark mode simulation | | --screenshots | | Capture screenshots (requires BROWSERLESS_URL) | | --out | -o | Output directory |

AI Fixes

The fix command requires an ANTHROPIC_API_KEY environment variable and the @anthropic-ai/sdk package:

npm install @anthropic-ai/sdk
export ANTHROPIC_API_KEY=sk-ant-...

Use --estimate to check token usage before making an API call:

emailens fix email.html --estimate
#   Input tokens:    ~4,200
#   Output tokens:   ~5,400
#   Warnings:        23 (5 structural)

Framework Support

The CLI can compile React Email (JSX/TSX), MJML, and Maizzle templates to HTML before analysis. Format is auto-detected from file extension, or specify with --format.

emailens analyze newsletter.tsx              # Auto-detected as JSX
emailens analyze template.mjml               # Auto-detected as MJML
emailens preview email.html --format maizzle # Explicit format

Framework compilers are optional peer dependencies; install only what you need:

npm install sucrase react @react-email/components @react-email/render  # For JSX
npm install mjml                                                        # For MJML
npm install @maizzle/framework                                          # For Maizzle

Screenshots

Screenshots require a Browserless instance and playwright-core:

npm install playwright-core
export BROWSERLESS_URL=ws://localhost:3000
emailens preview email.html --screenshots --out ./screenshots

Piping

Read from stdin with -:

cat email.html | emailens analyze -
echo '<html><body>Hello</body></html>' | emailens preview - --json

License

MIT


If this saved you from an Outlook surprise, a star helps other email developers find it.