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

@veap/mail

v0.1.6

Published

Mail and communication transport abstraction for Veap

Readme

CI Release Version

@veap/mail

Modular email and notification transport abstraction with support for Nodemailer, SMTP, Console logging, and custom mail drivers for Veap applications.

Overview

@veap/mail provides a unified messaging interface decoupling application logic from email delivery protocols. It supports zero-configuration development environments with automatic console logging, robust SMTP / Nodemailer delivery in production, and a custom driver port (CUSTOM_MAILER) for external email services such as AWS SES, Postmark, or Resend.

Features

  • Multiple mail transports: Built-in support for Nodemailer (SMTP, Google App Passwords) and zero-config ConsoleMailService for local development.
  • Unified sendMail facade: Simple, consistent API for sending plain text, HTML, and rich multipart emails.
  • Authentication notification helpers: Out-of-the-box functions for sendResetPassword and sendVerifyEmail with customizable templates.
  • IoC-driven lifecycle: MailServiceProvider handles automatic driver selection and credentials parsing during application boot.
  • Custom mailer support: Extendable driver architecture via the CUSTOM_MAILER token.

Installation

# Using bun
bun add @veap/mail @veap/kernel

# Using pnpm
pnpm add @veap/mail @veap/kernel

# Using npm
npm install @veap/mail @veap/kernel

Configuration

@veap/mail detects transports automatically from environment variables:

| Environment Variable | Description | | ---------------------------------------- | ---------------------------------------------------- | | MAIL_TRANSPORT | Delivery driver (smtp, console, or custom) | | MAIL_SERVICE | Well-known Nodemailer service (for example, gmail) | | MAIL_USERNAME / MAIL_PASSWORD | Standard SMTP credentials | | GOOGLE_SMTP_APP_USERNAME / _PASSWORD | Alternative Google App password credentials | | MAIL_FROM_ADDRESS | Default sender email address |

When no credentials or MAIL_TRANSPORT are set, @veap/mail defaults safely to ConsoleMailService so local development and tests run without network errors.

Usage

Register in Application Builder

Include MailServiceProvider in your application composition root:

import { Application } from "@veap/kernel";
import { MailServiceProvider } from "@veap/mail";

export const app = Application.configure().use(MailServiceProvider).create();

Sending Emails

Send transactional messages from services or server actions:

import { sendMail } from "@veap/mail";

await sendMail({
  to: "[email protected]",
  subject: "Welcome to Our Platform",
  text: "Thank you for creating an account with us!",
  html: "<h1>Welcome!</h1><p>Thank you for creating an account with us!</p>",
});

Registering a Custom Mailer

Implement the IMailer interface and bind it under CUSTOM_MAILER:

import { ServiceProvider } from "@veap/kernel";
import { CUSTOM_MAILER, type IMailer, type MailMessage } from "@veap/mail";

export class ResendMailService implements IMailer {
  async send(message: MailMessage): Promise<void> {
    // Send via third-party SDK (e.g., resend.emails.send)
  }
}

export class CustomMailServiceProvider extends ServiceProvider {
  register(): void {
    this.container.register({
      token: CUSTOM_MAILER,
      useClass: ResendMailService,
      singleton: true,
    });
  }
}

Subpath Exports

| Export Path | Content | | ------------ | ---------------------------------------------------------------------------------------- | | @veap/mail | Mail facades (sendMail), providers, interfaces (IMailer, MailMessage), and context |

Documentation

For full guides and transport configuration options, visit:

License

MIT