_Email.md_

CLI

Render markdown to email-safe HTML from the command line.

Email.md ships with a built-in CLI.

Install

If emailmd is already a project dependency, you can run it via npx:

npx emailmd input.md

To install it as a global command:

npm install -g emailmd

Usage

emailmd [file] [options]

If no file is given, the CLI reads from stdin.

Options

OptionDescription
-o, --output <f>Write output to a file instead of stdout
-t, --textOutput plain text instead of HTML
-h, --helpShow help
-v, --versionShow version number

Examples

Render a markdown file to HTML:

emailmd input.md

Write the output to a file:

emailmd input.md -o output.html

Get the plain text version (for the text/plain MIME part):

emailmd input.md --text

Pipe from another command:

echo "# Hello" | emailmd
curl -s https://example.com/template.md | emailmd -o email.html

On this page