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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sempervirens/emailer

v0.2.1

Published

A wrapper for Nodemailer, it provides a simplified interface for sending emails

Readme

Sempervirens Emailer

A wrapper for Nodemailer, it provides a simplified interface for sending emails.

Tests badge Version badge

Features

  • Checks if the body parameter is HTML or plain text, and if plain text, it adds the plain text to the email in case the recipient client is not HTML compatible.
  • Enables creating an Emailer instance that can be pre-configured and used across the process.
  • Enables calling only send without pre-configuring.
  • Provides Gmail as the default service.

Installation

npm i @sempervirens/emailer

Usage

Quick Start

  1. Setup a Gmail account with an app password.

  2. Import Emailer.

  3. (Optional) Initialize emailer with name, from, and password so those parameters may be omitted when calling send.

  4. Call send, with or without name, from, and password.

Note: If initialized, it is only necessary to pass name, from, and password into emailer once. Then importing emailer anywhere else, it is only necessary to call send.

import emailer from '@sempervirens/emailer';

(async () => {

  // Without initializing

  const data1 = await Emailer.send({
    name: 'From name',
    from: 'From email',
    password: 'Gmail app password',
    to: 'To email',
    subject: 'Email subject',
    body: 'Email text or HTML'
  });

  // With initializing

  const emailer = new Emailer({
    name: 'From name',
    from: 'From email',
    password: 'Gmail app password'
  });

  // In a file somewhere else
  const data2 = await emailer.send({
    to: 'To email',
    subject: 'Email subject',
    body: 'Email text or HTML'
  });

})();

Advanced

const data3 = await Emailer.send({
  options: {
    service: 'gmail',
    auth: {
      user: 'From email',
      auth: 'Gmail app password'
    }
  },
  to: 'To email',
  subject: 'Email subject',
  body: 'Email text or HTML'
});

API

constructor

| Param | Type | Description | |--------|------|-------------| | name | string | Required if options not given. From name to be displayed with from email. | | from | string | Required if options not given. From email. | | password | string | Required if options not given. From email password or app password. | | options | object | Required if name, from, password not given. Nodemailer options. |

send (static or instance)

Note: If using the static function, name, from, password, etc. are required.

| Param | Type | Description | |--------|------|-------------| | name | string | Required if static and options not given. From name to be displayed with from email. | | from | string | Required if static and options not given. From email. | | password | string | Required if static and options not given. From email password or app password. | | options | object | Required if static and name, from, password not given. Nodemailer options. | | to | string | Required. The to email address. | | subject | string | Recommended. The email subject. | body | string | Recommended. HTML or plain text email body.