Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including dropmail with all npm packages installed. Try it out:

var dropmail = require("dropmail")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

dropmail v1.0.5 api thingy for node

[npm-image]: [npm-url]:

📧 dropmail nodejs

[![NPM version][npm-image]][npm-url] Downloads
Dependencies Known Vulnerabilities NPM quality

Temporal mail for node, that works for now :p


What's it about

DropMail api for NodeJS, for generating random temporal emails and reading the inbox, you can also forward emails to other emails :)

Internally it connects to wss:// via websocket to get emails and listen for inwards emails



$ npm install dropmail



What better explanation that the real deal, here is what it can do:

const DropMail = require('dropmail');

 * DropMail will create a temporal email for a random domain
 * or a specific one if you pass it in to the constructor
let mail = new DropMail('');

 * Event for when mail is ready
 * you need to listen to this event or to 'address' event 
 * before you can make use of 'forward' and get the 'address' and 'hash'
mail.on('ready', () => {
   * Forward all email to ''
   * will send a confirmation email, can be in spam
    .then((res) => console.log(res))
    .catch((err) => console.log(err));

 * Event for when generated address is received
mail.on('address', (address) => {
  console.log('Got address: (' + address.address + ') with hash: (' + address.hash + ').');

 * Event for when list of domains is received
mail.on('domains', (domains) => {
  console.log('Got domains:', domains);

 * Event for when an email is received
mail.on('email', (email) => {
  console.log('Got email:', email);

process.on('SIGINT', () => {
   * Close the mail, no longer will it be able to receive messages



Create a temp email, and listen to inbox:

dropmail create [--domain <domain> --forward <email>]


List all available domains

dropmail domains



This is the only thing you will use.


interface DropMail extends EventEmitter {
  address: EmailAddress;
  constructor(domain?: string): DropMail;
  forward(to: string, locale?: string): Promise<any>;
  close(): void;

  // EventEmitter
  addListener(event: string | symbol, listener: (...args: any[]) => void): this;
  on(event: string | symbol, listener: (...args: any[]) => void): this;
  once(event: string | symbol, listener: (...args: any[]) => void): this;
  prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
  removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
  removeAllListeners(event?: string | symbol): this;
  setMaxListeners(n: number): this;
  getMaxListeners(): number;
  listeners(event: string | symbol): Function[];
  emit(event: string | symbol, ...args: any[]): boolean;
  eventNames(): Array<string | symbol>;
  listenerCount(type: string | symbol): number;


Email address little thingy:

interface EmailAddress {
  address: string;
  hash: string;
  client: ws.WebSocket;
  constructor(address, hash, client): EmailAddress;
  json(): Object;


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free