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

node-red-supemail-node

v1.0.7

Published

A Node-RED node for sending the latest file as an email attachment

Readme

Node-RED Latest File Email Node

A Node-RED node that monitors a directory and sends the latest file as an email attachment.

Features

  • Monitors a specified directory for files
  • Sends the latest file as an email attachment
  • Configurable email server settings
  • Configurable sender and multiple recipients
  • Configurable email subject and body
  • Detailed error handling and logging
  • Secure password storage

Installation

Via Node-RED Palette Manager

  1. Open Node-RED
  2. Click Menu → Manage Palette
  3. Switch to "Install" tab
  4. Search for "node-red-email-node"
  5. Click Install

Manual Installation

cd ~/.node-red
npm install node-red-email-node

Configuration

Email Server Settings

  1. Double click the node to open configuration
  2. Click the pencil icon next to "Email Config"
  3. Configure the following:
    • Name: A name for this configuration
    • Host: SMTP server hostname (e.g., smtp.gmail.com)
    • Port: SMTP server port (default: 587)
    • Secure: Use SSL/TLS (check for port 465)
    • User: SMTP username
    • Password: SMTP password
    • From: Sender email address
    • To: Recipient email addresses (multiple addresses can be separated by commas)
    • Subject: Email subject
    • Text: Email body text
    • Watch Directory: Directory to monitor for files

Node Settings

  • Name: Optional name for the node

Usage

  1. Deploy the node
  2. The node will trigger when it receives any input message
  3. It will find the latest file in the configured directory
  4. The file will be sent as an attachment to all configured email addresses

Input

Any message will trigger the node to send the latest file.

Output

The node outputs a message with the following properties:

{
    "payload": {
        "success": true,
        "messageId": "message-id",
        "file": "filename.ext",
        "recipients": ["[email protected]", "[email protected]"]
    }
}

Example Flow

[
    {
        "id": "trigger-node",
        "type": "inject",
        "name": "Trigger",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "wires": [
            [
                "email-node"
            ]
        ]
    },
    {
        "id": "email-node",
        "type": "email-node",
        "name": "Send Latest File",
        "emailConfig": "email-config-node",
        "wires": [
            [
                "debug-node"
            ]
        ]
    }
]

Development

Prerequisites

  • Node.js 14 or later
  • npm 6 or later

Setup

# Clone the repository
git clone https://github.com/yourusername/node-red-email-node.git

# Install dependencies
cd node-red-email-node
npm install

# Run tests
npm test

Testing

The node includes comprehensive tests:

  • File system operations
  • Email transport configuration
  • Email sending functionality
  • Error handling

Run tests with:

npm test

Troubleshooting

Common Issues

  1. No files found

    • Check if the watch directory exists
    • Verify directory permissions
  2. Email not sending

    • Verify SMTP server settings
    • Check credentials
    • Ensure network connectivity
  3. Authentication failed

    • Double-check username and password
    • For Gmail, you may need an App Password
  4. Multiple recipients not working

    • Ensure email addresses are separated by commas
    • Check for any spaces before or after email addresses
    • Verify all email addresses are valid

Debug Mode

Enable debug mode in Node-RED to see detailed logs:

  1. Open Node-RED settings
  2. Enable debug mode
  3. Deploy and check debug messages

License

MIT

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request