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

opex-tempmail.so

v1.0.0

Published

A Node.js library to interact with a temporary email service API - tempmail.so

Readme

Temp Mail Client

A simple Node.js ESM library to programmatically create temporary email addresses and receive emails, based on the API used by temp-mail.org.

Disclaimer: This library is based on reverse-engineering the public API of a third-party service. It may break at any time if the service changes its API. Please use it responsibly and ethically.

Features

  • Generate a new temporary email address.
  • Fetch all emails from the inbox.
  • Read the full HTML body of a specific email.
  • Delete a specific email.
  • Delete the entire inbox to get a new address.
  • Session management with cookies.

Installation

npm install axios axios-cookiejar-support tough-cookie

Usage

Here is a basic example of how to use the library.

import { createTempMailClient } from './src/index.js';

async function run() {
  try {
    // Initialize the client and get the first email address
    const client = await createTempMailClient();
    console.log(`Your temporary email is: ${client.address}`);

    // Wait for an email to arrive
    console.log('Waiting for an email...');
    const firstMail = await client.waitForFirstMail({ timeout: 60000 }); // 60-second timeout

    console.log('--- New Email Received ---');
    console.log(`From: ${firstMail.from}`);
    console.log(`Subject: ${firstMail.subject}`);

    // Read the email's content
    const body = await client.getMailBody(firstMail.id);
    console.log('--- Email Body ---');
    console.log(body.substring(0, 200) + '...'); // Print first 200 chars

    // Get a new email address
    console.log('\nGetting a new email address...');
    const newAddress = await client.deleteInbox();
    console.log(`Your new temporary email is: ${newAddress}`);

  } catch (error) {
    console.error(error.message);
  }
}

run();

API Reference

createTempMailClient(options)

A factory function to create and initialize a client instance.

  • options (Object): Optional configuration.
    • baseUrl (String): The base URL of the temp mail service. Defaults to https://temp-mail.org.
    • lang (String): The language code for API endpoints. Defaults to en.
  • Returns: Promise<TempMailClient> - A promise that resolves to an initialized client instance.

Class: TempMailClient

client.address

  • Type: string
  • The current temporary email address.

client.mails

  • Type: Array<object>
  • An array of mail objects currently in the inbox.

async client.init()

  • Initializes the client and gets the first email address.
  • Returns: Promise<string> - The new email address.

async client.getMails()

  • Refreshes and returns the list of emails in the inbox.
  • Returns: Promise<Array<object>>

async client.getMailBody(mailId)

  • Fetches the HTML body of a specific email.
  • mailId (String): The ID of the email.
  • Returns: Promise<string> - The HTML content.

async client.deleteInbox()

  • Deletes the current inbox and gets a new one.
  • Returns: Promise<string> - The new email address.

async client.deleteMail(mailId)

  • Deletes a specific email from the inbox.
  • mailId (String): The ID of the email.
  • Returns: Promise<boolean> - true on success.

async client.waitForFirstMail(options)

  • Polls the inbox until the first email arrives.
  • options (Object):
    • timeout (Number): Time to wait in ms. Defaults to 60000.
    • interval (Number): Polling interval in ms. Defaults to 5000.
  • Returns: Promise<object> - The first mail object. Rejects on timeout.

Author

Created by OpexDev