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

mailer-advance

v10.0.1

Published

Advanced Node.js email service with dynamic SMTP configuration, multi-database support (MongoDB/SQL), and a built-in UI.

Readme

🚀 mailer-advance v10.0

npm version license Node version

mailer-advance is a high-performance Node.js email engine with absolute flexibility. It features dynamic SMTP hot-swapping, multi-DB persistence, and a premium "management-in-a-box" UI.


⚡ Quick Start: Get Running in 60 Seconds

  1. Install: npm install mailer-advance
  2. Configure: Set DB_URI in your .env.
  3. Launch:
    import { DatabaseFactory, dbService } from 'mailer-advance';
    const repo = DatabaseFactory.createRepository('mongodb');
    await repo.connect(); // Automatically uses process.env.DB_URI
    dbService.setRepository(repo);

✨ v9.0 Highlights

  • Smart Connection: connect() automatically falls back to process.env.DB_URI.
  • 📖 Interactive Swagger UI: Now fully supported with fixed asset paths.
  • 🗄️ Multi-DB Persistence: Support for MongoDB, Postgres, and MySQL.
  • 🔄 Hot-Swapping: Switch SMTP credentials at runtime via the Dashboard.
  • 🛡️ Production Ready: Full STARTTLS support and descriptive error guards.

📦 Installation

npm install mailer-advance

🚀 Quick Start (Library Mode)

import express from 'express';
import { 
    contactRoutes, 
    configRoutes, 
    swaggerRoutes,
    dbService, 
    DatabaseFactory 
} from 'mailer-advance';

const app = express();
app.use(express.json());

// 1. Initialize Persistence (Smart Fallback to process.env.DB_URI)
const repository = DatabaseFactory.createRepository(process.env.DB_TYPE || 'mongodb');
await repository.connect(); 
dbService.setRepository(repository);

// 2. Mount API Routes (Use these exact paths for Swagger compatibility)
app.use('/api', contactRoutes); 
app.use('/api/config', configRoutes);
app.use('/api-docs', swaggerRoutes);

app.listen(3000, () => {
    console.log('🚀 Engine active at http://localhost:3000');
    console.log('📖 API Docs: http://localhost:3000/api-docs');
});

📚 Interactive API Documentation (Swagger)

V9.0.0 fixes the "No operations defined" error by ensuring consistent mount paths. Always mount the routes as shown in the Quick Start to maintain Swagger compatibility.

👉 app.use('/api-docs', swaggerRoutes);

Once mounted, navigate to: http://localhost:3000/api-docs

From there, you can:

  • 🔍 Explore: See all available endpoints and their data structures.
  • 🧪 Test: Send live requests to your mailer engine directly from the browser.
  • 📜 Spec: Download the OpenApi spec for use in other tools.

⚙️ Environment Configuration (.env)

| Variable | Requirement | Description | |----------|-------------|-------------| | DB_TYPE | Required | mongodb, postgres, or mysql (Default: mongodb) | | DB_URI | Required | Your database connection string. | | MAIL_HOST | Optional | Default SMTP Host (Fallback). | | MAIL_PORT | Optional | Default SMTP Port (Default: 587). |

💡 The .env Setup Guide

# Database
DB_TYPE=mongodb
DB_URI=mongodb://127.0.0.1:27017/my_mailer_db

# Fallback SMTP
MAIL_HOST=smtp.your-provider.com
MAIL_PORT=587
[email protected]
MAIL_PASS=your-secure-password

🔒 Security & Best Practices

  • App Privacy: Always wrap the mailer routes/UI with your own authentication middleware.
  • TLS validation: Ensure rejectUnauthorized is true for production SMTP.
  • Secrets: Encrypt your .env files using Dotenvx.

📜 License

MIT © Pranay