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

mailatt

v0.0.0-beta.9

Published

Send email attachments

Downloads

13

Readme

mailatt

The first objective of this package comes from the need to get a daily backup to my email with attachments. Let's say you need to back up a database every day and send a compressed file to the same email, several times a week as a cron job.

Requirement

Node.js v6+

1. Installation and run cli

Globally

$ npm install -g mailatt
$ mailatt --version

Inside a npm package

$ npm install mailatt
$ ./node_modules/.bin/mailatt --version

2. Configuration

To use this command, you need an SMTP address transport with the username and password that you can configure with the --configure parameter.

You will be prompted to enter the configuration :

Question | Description --- | --- SMTP address: | The SMTP server address username: | The SMTP user name password: | The SMTP password to: | The email of the recipient reply To: | The email to reply from: | The email of the sender subject: | The subject of the email html: | The body text in html format

Example:

$ mailatt --configure

? SMTP address: smtp.example.com
? username:     username
? password:     password
? to:           [email protected]
? reply To:     [email protected]
? from:         [email protected]
? subject:      daily backup
? html:         <h1>My Backup</h1>
The configuration was saved!

3. Send attachments

When the configuration is complete, this package uses an email template with attachments specified by his operands. You can send multiple attachments by adding multiple paths separate by space. If the email is sent successfully, you will receive a confirmation message. email sent successfully! If not, you will get an error why. Example:

$ mailatt ./backup1.zip ./backup2.zip
email sent successfully!

Note that you can use wildcard character * as operands to send attachments that correspond to the pattern matching. Example:

$ mailatt *.zip
email sent successfully!

API

Usage: mailatt [options] [file ...]

Options:

  --configure          configure the transport and the email fields
  --version            output the version number

Upgrade

$ npm install -g mailatt@latest
# or
$ npm install mailatt@latest

Unistall

$ npm uninstall -g mailatt
# or
$ npm uninstall mailatt