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

newsletter-cli

v0.5.0

Published

Easy CLI to send newsletters from your machine

Downloads

9

Readme

Features

✍️ Markdown for writing the content

🌈 Styling using CSS (automatically inlined)

📨 Send using AWS SES respecting rate limits

Prerequisites

Prepare your AWS SES account and configure access to AWS on your machine:

  • https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sign-up-for-aws.html
  • https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html

Getting Started

npm i newsletter-cli -g
  • Step 1: Run newsletter prepare to get started. Follow the command's instructions.
  • Step 2: Run newsletter edit <newsletter-name> to open the prepared markdown file for the newsletter using an editor. Write your newsletter!
  • Step 3: Run newsletter preview <newsletter-name> to preview the resulting HTML of your newsletter in a web-browser.
  • Step 4: Run newsletter send <newsletter-name> <recipients-csv> <from-email> to send the newsletter in bulks respecting the send rate of AWS SES.

Parameters

  • <newsletter-name> is the internal name for your newsletter (alphanumerical characters and -, _ only). The newsletter name defines the name of the local file where the newsletter source is stored. is stored as .md
  • <recipients-csv> is the path to a file containing recipients of the newsletter. The file must be comma-separated (,) and must contain column headers in the first row. The column named 'email' must be present in the file
  • <from-email> is the email address which will appear as the sender of the newsletter.

Using variables in the template

You can use variables in the templates as supported by AWS SES. The variables can be used in the subject and inside the body:

---
subject: Hi {{name}}! Subject of your awesome newsletter!
---

Hi {{name}}!

Here goes the text of your awesome newsletter!

In the snippet above, the name column is required for all recipients in the CSV file.

Unfortunately, if the template rendering fails, AWS SES does not return an error. To detect rendering errors, you will need to subscribe to build an async recovery mechanism as described here.

The reasons why template rendering can fail:

  • missing variables
  • typos in variable names
  • invalid template expressions

The CLI tries to validate as much as possible but it's still recommended to set up a recovery mechanism for the rendering failures.

User configuration file

An optional user configuration file can be placed at ${HOME}/.newsletter-cli/config.js, which allows certain customizations. The sample user configuration is commented with the possible customizations.

Get Help

Open an issue