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

@sugarcube/plugin-mail

v0.42.1

Published

Send email notifications.

Downloads

7

Readme

@sugarcube/plugin-mail

Plugins for SugarCube ...

Installation

npm install --save @sugarcube/plugin-mail

Plugins

mail_failed_stats

This plugin emails any failed queries that occur during a pipeline run. It looks up the list of queries in the failed attribute of the stats object. It will send an email to qvery recipient supplied using the mail_recipient query type. If there are no failed queries, the email sending will be skipped.

Configuration:

Uses mail_recipient as query type.

  • mail.debug

    Turn on debug mode. In this mode mails are not actually sent, but only logged to the screen.

  • mail.no-encrypt

    Disable the gpg encryption for this run. Emails will be send in clear text. Every email is encrypted using gpg before sending. The gpg binary must be installed and the recipient's public key imported into the users keyring and be trusted. The email won't send if the encryption fails.

    FIXME: Not tested on Windows, how would it work there with the gpg binary?

  • mail.from

    Set this email address as sender in the From: header.

  • mail.smtp_user

    Configure the user account for the SMTP server in use.

  • mail.smtp_password

    Configure the password for the SMTP server in use.

  • mail.smtp_host

    Configure the host name of the SMTP server in use.

  • mail.smtp_port

    Configure the port of the SMTP server in use.

mail_pipeline_stats

A pipeline run collects a lot of instrumentation details during a run. This plugin creates a run report and emails it. It will send an email to qvery recipient supplied using the mail_recipient query type.

Configuration:

Uses mail_recipient as query type.

  • mail.debug

    Turn on debug mode. In this mode mails are not actually sent, but only logged to the screen.

  • mail.no-encrypt

    Disable the gpg encryption for this run. Emails will be send in clear text. Every email is encrypted using gpg before sending. The gpg binary must be installed and the recipient's public key imported into the users keyring and be trusted. The email won't send if the encryption fails.

    FIXME: Not tested on Windows, how would it work there with the gpg binary?

  • mail.from

    Set this email address as sender in the From: header.

  • mail.smtp_user

    Configure the user account for the SMTP server in use.

  • mail.smtp_password

    Configure the password for the SMTP server in use.

  • mail.smtp_host

    Configure the host name of the SMTP server in use.

  • mail.smtp_port

    Configure the port of the SMTP server in use.

mail_diff_stats

This plugin sends statistics of type diff. It will send an email to every recipient supplied using the mail_recipient query type. Skip the emailing if there are no added of removed stats available.

Configuration:

Uses mail_recipient as query type.

  • mail.debug

    Turn on debug mode. In this mode mails are not actually sent, but only logged to the screen.

  • mail.no-encrypt

    Disable the gpg encryption for this run. Emails will be send in clear text. Every email is encrypted using gpg before sending. The gpg binary must be installed and the recipient's public key imported into the users keyring and be trusted. The email won't send if the encryption fails.

    FIXME: Not tested on Windows, how would it work there with the gpg binary?

  • mail.from

    Set this email address as sender in the From: header.

  • mail.smtp_user

    Configure the user account for the SMTP server in use.

  • mail.smtp_password

    Configure the password for the SMTP server in use.

  • mail.smtp_host

    Configure the host name of the SMTP server in use.

  • mail.smtp_port

    Configure the port of the SMTP server in use.

The following example diffs two csv files, and mails in debug mode the diff statistics to two recipients.

$(npm bin)/sugarcube -d \
  -Q mail_recipient:[email protected] \
  -Q mail_recipient:[email protected] \
  -Q glob_pattern:data/dump-$(date -d "today" +%Y-%m-%d).csv \
  -Q diff_glob_pattern:data/dump-$(date -d "yesterday" +%Y-%m-%d).csv \
  -p csv_import,csv_diff,mail_diff_stats \
  --csv.id_fields name \
  --mail.from [email protected] \
  --mail.debug

Instruments

mail_report

Mail a report at the end of a pipeline run. The report breaks down per plugin the statistics collected and includes a list of all failures that occurred. The failures are additionally attached as a CSV file. As a default all emails are gpp encrypted. For this you need to import all GPG keys of your recipients into the local keyring. You can opt-out of email encryption by setting the mail.no_encrypt to true.

Configuration:

  • mail.recipients: A list of email addresses that should receive the report.
  • mail.no_encrypt: Disable the gpg encryption for this run. Emails will be send in clear text. Every email is encrypted using gpg before sending. The gpg binary must be installed and the recipient's public key imported into the users keyring and be trusted. The email won't send if the encryption fails.
  • mail.from: Set this email address as sender in the From: header.
  • mail.smtp_user: Configure the user account for the SMTP server in use.
  • mail.smtp_password: Configure the password for the SMTP server in use.
  • mail.smtp_host: Configure the host name of the SMTP server in use.
  • mail.smtp_port: Configure the port of the SMTP server in use.

License

GPL3 @ Christo