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 🙏

© 2024 – Pkg Stats / Ryan Hefner

maildown

v0.0.1-rc7

Published

Write transactional and marketing emails using MJML & Markdown

Downloads

22

Readme

💌 MailDown

MailDown is (very much an alpha) CLI tool for writing transactional and marketing emails using markdown.

MM comes with a slew of impressive features, such as:

📱 Responsiveness by default: MailDown uses MJML under-the-hood for its styling, layout engine and transpiler, so you can be assured that your emails will look beautiful on every device.

🔁 Variable interpolation: Using the incredibly-fast ETA templating language, MailDown allows you to inject variables into your email templates at runtime.

🙏🏻 No runtime overhead: MailDown compiles your email templates to regular JavaScript functions, so there's no need to read HTML files from the filesystem or use MJML at runtime.


MailDown is still an unpublished project and in active development. Expect bugs.

How to use

Using MailDown is dead-simple. Once the CLI is installed (after we publish it lol), you can set up a project similar to the following:

emails/
  en/
    hello-world.email.md

Where hello-world.email.md might look something like:

# Hello world!

Hey {{ name }},

This is a test email!

Then, in your root directory, run:

$ maildown generate

which will produce an index.js file inside the emails directory.

You can then use your email templates as follows:

import { helloWorld } from './emails';

console.log(helloWorld.en.html({ name: 'John Doe' }));

You can check out the example folder for a fuller example!

Why would I need this?

With the plethora of high-end email suites like SendGrid and MailChimp, it might be inconceivable why you want (or need) a library like this. There are a few reasons we decided to build this library, so let's look at them:

  • Money: As your company grows, tools like SendGrid and MailChimp only become more and more expensive. Cheaper alternatives, such as AWS SES don't feature snazzy template builders and expect you to bring your own HTML. That's where MailDown comes in.
  • Control: Keeping all your email templates inside a SaaS product limits the portability of those templates if you decide to move to a different provider in the future. MailDown allows you to keep your email templates checked-in to version control, so you can send them using any provider.
  • Customization: By giving developers full control over their email's styling, HTML, and content, they have the ability to bypass any restrictions imposed by a SaaS product.

A word to the wise

Considering MailDown allows you to bypass needing to rely on a SaaS product for your emails, it will be your responsibility to implement contact management and unsubscribe links. This is crucial, as not providing a way for users to unsubscribe from emails may break anti-spam laws.