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.mdTo install it as a global command:
npm install -g emailmdUsage
emailmd [file] [options]If no file is given, the CLI reads from stdin.
Options
| Option | Description |
|---|---|
-o, --output <f> | Write output to a file instead of stdout |
-t, --text | Output plain text instead of HTML |
-h, --help | Show help |
-v, --version | Show version number |
Examples
Render a markdown file to HTML:
emailmd input.mdWrite the output to a file:
emailmd input.md -o output.htmlGet the plain text version (for the text/plain MIME part):
emailmd input.md --textPipe from another command:
echo "# Hello" | emailmd
curl -s https://example.com/template.md | emailmd -o email.html