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

universal-email-templates-cli

v1.0.1

Published

CLI tools for building, translating and exporting professional MJML email templates to Mailchimp, Klaviyo, and HubSpot

Readme

Universal Email Templates CLI

CLI tools for building, translating, and exporting professional MJML email templates.

Features

  • Build MJML templates to HTML
  • Multi-language support (FR, EN, ES, DE, IT, PT, NL, AR)
  • Export to Mailchimp, Klaviyo, and HubSpot formats
  • WCAG 2.1 AAA accessibility compliant
  • Dark mode support

Installation

npm install -g universal-email-templates-cli

Or as a project dependency:

npm install universal-email-templates-cli

CLI Usage

Build Templates

# Build all MJML templates to HTML
email-build --src ./src/templates --dist ./dist/html

# Build with options
email-build --src ./src/templates --dist ./dist/html --minify

Internationalization

# Build all languages
email-i18n --all --src ./src/templates --dist ./dist/i18n

# Build specific language
email-i18n --lang fr --src ./src/templates --dist ./dist/i18n

# Build with themes
email-i18n --lang en --themed --src ./src/templates --dist ./dist/i18n

Export to Platforms

# Export to Mailchimp
email-export --platform mailchimp --src ./dist/html --dist ./dist/mailchimp

# Export to Klaviyo
email-export --platform klaviyo --src ./dist/html --dist ./dist/klaviyo

# Export to HubSpot
email-export --platform hubspot --src ./dist/html --dist ./dist/hubspot

Generate Preview Examples

# Generate examples for all languages
email-examples --dist ./dist --examples ./examples --config ./config/examples

# Generate English only
email-examples en --dist ./dist --examples ./examples --config ./config/examples

# Generate French only
email-examples fr --dist ./dist --examples ./examples --config ./config/examples

# Clean and regenerate
email-examples --clean --dist ./dist --examples ./examples --config ./config/examples

Programmatic Usage

const { build, translate, exportTo } = require('universal-email-templates-cli');

// Build templates
await build({
  src: './src/templates',
  dist: './dist/html',
  minify: true
});

// Translate templates
await translate({
  src: './src/templates',
  dist: './dist/i18n',
  languages: ['fr', 'en', 'es'],
  translations: require('./config/translations')
});

// Export to platform
await exportTo({
  platform: 'mailchimp',
  src: './dist/html',
  dist: './dist/mailchimp'
});

Configuration

Translations

Create a translations.js file:

module.exports = {
  en: {
    greeting_hello: 'Hello',
    btn_get_started: 'Get Started',
    unsubscribe: 'Unsubscribe'
  },
  fr: {
    greeting_hello: 'Bonjour',
    btn_get_started: 'Commencer',
    unsubscribe: 'Se desabonner'
  }
};

Platform Variable Mappings

| Our Variable | Mailchimp | Klaviyo | HubSpot | |--------------|-----------|---------|---------| | {{first_name}} | *\|FNAME\|* | {{ first_name }} | {{ contact.firstname }} | | {{email}} | *\|EMAIL\|* | {{ email }} | {{ contact.email }} | | {{unsubscribe_url}} | *\|UNSUB\|* | {% unsubscribe_url %} | {{ unsubscribe_link }} |

Supported Languages

| Code | Language | |------|----------| | en | English | | fr | French | | es | Spanish | | de | German | | it | Italian | | pt | Portuguese | | nl | Dutch | | ar | Arabic |

License

MIT