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

adeel-mail-js

v1.0.9

Published

A lightweight SMTP mail server provider compatible with Nodemailer for sending transactional emails.

Readme

Adeel Mail

A lightweight SMTP mail helper built on top of Nodemailer. adeelMail provides a simple class-based interface to configure an SMTP transporter and send transactional emails.

Files of interest:

Overview

Create an instance of adeelMail with SMTP configuration (host, port, user, pass). Call mail() to obtain an object with a send async method to send emails.

Constructor parameters

Use the constructor like this:

new adeelMail({ host, port, secure = false, user, pass, globals = { from: "" } })
  • host (string) — SMTP server host (required)
  • port (number) — SMTP port (required)
  • secure (boolean) — Use TLS/SSL (default: false)
  • user (string) — SMTP username (required)
  • pass (string) — SMTP password (required)
  • globals (object) — global options, e.g. { from: "[email protected]" }

If any required parameter is missing, the constructor sets an internal error and mail() will not return a usable sender.

Sending mail

Call mail() to get the sender object, then use send:

const instance = new adeelMail({...});
const mail = instance.mail();
await mail.send({ from, to, subject, text, html });

send parameters:

  • from (string) — sender address; falls back to globals.from if not provided
  • to (string) — recipient address (required)
  • subject (string) — email subject (default: Hello From Adeel)
  • text (string) — plain-text body (default: Hello, adeelMail)
  • html (string) — HTML body (default: empty)

If to is missing, send throws an Error: "'to' is required.".

Return value

On success send returns a simple result object:

{
  success: true,
  email: { from, to }
}

Note: the underlying nodemailer result from transporter.sendMail() is awaited inside send, but the exported wrapper returns a minimal success payload.

Example

The example in examples/provider/booking.mail.js:

import { adeelMail } from "../../src/index.js";

const bookingInit = new adeelMail({
  host: "smtp.domain.com",
  port: 465,
  secure: true,
  user: "[email protected]",
  pass: "******",
  globals: { from: "[email protected]" }
});

const booking = bookingInit.mail();
await booking?.send({ to: "[email protected]" });

Dependencies

  • nodemailer (already declared in package.json)

Best practices

  • Do not hard-code credentials in source. Use environment variables or a .env file.
  • Always await the async send call to catch errors.
  • Validate required constructor fields before creating the instance.