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

@danielres/smtp-mini-dev-server

v1.4.5

Published

This provides a very basic, non-secure SMTP server to use in development, test and staging environments.

Downloads

22

Readme

SMTP mini dev server

This provides a very basic, non-secure SMTP server to use in development, test and staging environments.

Do not use this in production!

Persistance is ephemeral, in-memory only.

I find this to be a convenient replacement for tools like etherreal, mailcatcher and similar.

Features

  • Simple, fast, lightweight.
  • Convenient for e2e testing (Cypress, puppeteer, ...).
  • Allows developers, testers, product managers to inspect sent emails, but guarantees no development/test/staging emails ever get sent to real recipients.
  • Faster than using third-party services.

Installation

npm install --save-dev @danielres/smtp-mini-dev-server
or
yarn add -D @danielres/smtp-mini-dev-server

Usage

node_modules/.bin/smtp-dev
or
yarn smtp-dev
starts the SMTP server on port 2500 and the api server on port 2501.

Ports can be changed through environment variables:

Example:
DEV_SMTP_PORT=1234 DEV_SMTP_API_PORT=1235 yarn smtp-dev

Example usage with nodemailer (in non-production environments)

const config = {
  host: "localhost",
  port: 2500,
  secure: false,
  auth: {
    user: "username", // username and password don't matter, any are accepted
    pass: "password"
  }
};

const transport = nodemailer.createTransport(config);

const sendMessage = () => {
  const message = {
    from: "[email protected]",
    to: "...",
    subject: "...",
    text: "...",
    html: "<p>...</p>"
  };

  return new Promise((resolve, reject) => {
    transport.sendMail(message, (error, info, response) => {
      if (error) return reject(error);
      const url = `http://localhost:2501/${info.messageId}/html`;
      console.log({ url });
      resolve({ info, response, url });
    });
  });
};

sendMessage()

The url of the email message will appear in your terminal output (console.log({ url })).

You can now:

  • visit http://localhost:2501 for a list of all received messages.
  • visit http://localhost:2501/<MESSAGE_ID> for all data related to a paticular message.
  • view only specific data for a message:
    • http://localhost:2501/<MESSAGE_ID>/html
    • http://localhost:2501/<MESSAGE_ID>/text
    • ...

Screenshots

image

image

image