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

@mailloop/sdk

v0.1.0

Published

Official JavaScript/TypeScript SDK for the Mailloop email testing platform

Readme

@mailloop/sdk

Official JavaScript/TypeScript SDK for the Mailloop API.

Installation

npm install @mailloop/sdk
# or
yarn add @mailloop/sdk
# or
bun add @mailloop/sdk

Quick Start

import { MailloopClient } from '@mailloop/sdk';

const client = new MailloopClient({
  apiKey: 'ml_live_your_api_key_here'
});

// Create a sandbox
const sandbox = await client.sandboxes.create({ name: 'my-test' });
console.log(`Sandbox email: ${sandbox.emailAddress}`);

// Wait for an email to arrive
const email = await client.emails.waitFor(sandbox.id, {
  timeout: 30000,
  from: '[email protected]'
});
console.log(`Received: ${email.subject}`);

// Clean up
await client.sandboxes.delete(sandbox.id);

Features

  • Full TypeScript support with complete type definitions
  • Dual ESM and CommonJS builds
  • Zero dependencies (uses native fetch)
  • Long-polling email waiting with configurable timeouts
  • Temporary sandboxes with auto-cleanup

API Reference

MailloopClient

Create a client instance:

const client = new MailloopClient({
  apiKey: 'ml_live_...',     // Required: Your API token
  baseUrl: 'https://...',    // Optional: Custom API URL
  timeout: 30000             // Optional: Request timeout in ms (default: 30000)
});

Sandboxes

List sandboxes

const { sandboxes } = await client.sandboxes.list();

Create a sandbox

const sandbox = await client.sandboxes.create({
  name: 'my-sandbox'
});

Create a temporary sandbox

Temporary sandboxes auto-delete after the specified duration (max 60 seconds):

const sandbox = await client.sandboxes.createTemporary({
  duration: 30,  // Deletes after 30 seconds
  name: 'temp-test'
});

Get a sandbox

const sandbox = await client.sandboxes.get('sandbox-id');

Update a sandbox

const sandbox = await client.sandboxes.update('sandbox-id', {
  name: 'new-name'
});

Delete a sandbox

await client.sandboxes.delete('sandbox-id');

Emails

List emails in a sandbox

const { emails, total } = await client.emails.list('sandbox-id', {
  limit: 20,   // Optional: Max emails to return (default: 20, max: 100)
  offset: 0,   // Optional: Number of emails to skip
  after: 'id'  // Optional: Return emails after this ID
});

Get email details

const email = await client.emails.get('sandbox-id', 'email-id');
console.log(email.html);
console.log(email.attachments);

Wait for an email

Poll until an email arrives or timeout is reached:

try {
  const email = await client.emails.waitFor('sandbox-id', {
    timeout: 30000,      // Optional: Max wait time in ms (default: 30000, max: 60000)
    from: 'sender@...',  // Optional: Filter by sender
    to: 'recipient@...', // Optional: Filter by recipient
    subject: 'Reset'     // Optional: Filter by subject substring
  });
} catch (error) {
  if (error instanceof TimeoutError) {
    console.log('No email received within timeout');
  }
}

Error Handling

The SDK throws typed errors for different failure scenarios:

import {
  MailloopError,
  AuthenticationError,
  PermissionError,
  NotFoundError,
  RateLimitError,
  TimeoutError,
  ValidationError
} from '@mailloop/sdk';

try {
  const email = await client.emails.waitFor('sandbox-id');
} catch (error) {
  if (error instanceof AuthenticationError) {
    // Invalid or expired API token
  } else if (error instanceof PermissionError) {
    // Token lacks required permissions
  } else if (error instanceof NotFoundError) {
    // Sandbox or email not found
  } else if (error instanceof RateLimitError) {
    // Rate limit exceeded, retry after error.retryAfter seconds
  } else if (error instanceof TimeoutError) {
    // No email received within timeout
  } else if (error instanceof ValidationError) {
    // Invalid request parameters
  }
}

License

MIT