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

md-mailer

v0.0.8

Published

Send markdown emails from your command line.

Downloads

3

Readme

md-mailer

A simple tool to send markdown emails from the command line.

Installation

npm install -g md-mailer

Usage

md-mailer allows one to write emails in markdown, it supports embedded images and attachments.

To use it, first prepare your email:

---
from: John Appleseed <[email protected]>
to:   Jack Bananapeel <[email protected]>, Sue Orangeskin <[email protected]>
cc:   John Appleseed <[email protected]>
subject: An example email!
---

This is an example email! **Bold** text etc, it all works!

![an inline image](./image.jpg)

greets,
John

![an attached pdf](./document.pdf)

Just embed all the sending information in the frontmatter preamble of the email file.

To send the email, invoke md-mailer:

md-mailer -u <user> -h <host> -p <pass> --ssl file.md

Markdown interpolation

Sometimes, you need to be able to insert variable text into your email. To allow this, md-mailer extends markdown with a little of custom syntax:

Hi my name is ${NAME},

Thanks,
$NAME

will replace the ${NAME} and $NAME variables with their value (found in the environment). This also works for the frontmatter of your email:

---
to: $RECIPIENTS
from: $ME
subject: ${SUBJECT}
---
email...

Options

These can be passed as command line arguments, or as environment variables.

-h, --host, $MDMAILER_HOST, option.host

The hostname of the mail server to use. (Example: smtp.gmail.com).

-P, --port, $MDMAILER_PORT, options.port

The port of the mail server.

-u, --user, $MDMAILER_USER, options.user

The username of the account that should be used at the mail provider.

-p, --pass, $MDMAILER_PASS, options.pass

The password of the account that should be used at the mail provider.

Note: using the command line arguments like this might be unsafe, because the password will be stored cleatext in your shell history. Prefer setting the environment variable $MDMAILER_PASS.

--ssl, options.ssl

If present, md-mailer uses SSL.

-d, --dry-run

If present, md-mailer will not actually send any emails.

-?. --help

Show the help text.

Header options

These options can be set from the email message header.

from

The sender of the message. Can be of the form Name <email@host> or email@host.

to

A list of recipients to which the message will be sent. You can enter a comma-separated list of emails (in the formats described in from) or use yamls list syntax:

to:
- Sue Orangeskin <[email protected]> 
- [email protected]

is equivalent to

to: Sue Orangesking <[email protected]>, [email protected]

cc, bcc

The list of carbon copy and blind carbon copy recipients, the format used in to is also valid here.

subject

The subject of the message.

Node API

You can also use the api from node:

import mdmailer from 'md-mailer'
mdmailer({
  user: 'example'
, pass: '12345'
, host: 'smtp.gmail.com'
, ssl: true
, files: ['email1.md', 'email2.md' ]
});