New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

tmpmail

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tmpmail

NodeJS api for temporary mail

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
7
75%
Maintainers
1
Weekly downloads
 
Created
Source

Temporary Mail

NodeJS api for temporary emails

Install

npm install tmpmail

Usage

  • Create a temporary mail client
const TmpMail = require('tmpmail');
const client = TmpMail.Create();
  • Wait for client to initialize, and get your email address
client.on('ready', email => {
  console.log(email);

  // Or, alternatively:
  console.log(client.id);
});

Example output:

'2wyw9rtxwk@wwjmp.com'
  • Fetch messages
client.fetch().then(messages => {
  console.log(messages);
});

Example output:

[
  {
    _id: '3e1ee21c5cce2436daa1e8206923695e',
    from: 'example@test.com',
    to: '2wyw9rtxwk@wwjmp.com',
    subject: 'Hello world!',
    date: 2021-02-09T11:46:42.000Z
  },
  {
    _id: '3e1ee21c5cce2436daa1e8206923b38a',
    from: 'example@test.com',
    to: '2wyw9rtxwk@wwjmp.com',
    subject: 'Hello world (for the second time)!',
    date: 2021-02-09T11:46:57.000Z
  }
]
  • Get email body
client.findMessage('3e1ee21c5cce2436daa1e8206923695e').then(msg => {
  console.log(msg);
});

Example output:

{
  _id: '3e1ee21c5cce2436daa1e8206923695e',
  from: 'example@test.com',
  to: '2wyw9rtxwk@wwjmp.com',
  subject: 'Hello world!',
  date: 2021-02-09T11:46:42.000Z,
  body: {
    text: 'Hello world from a stranger!',
    html: ''
  }
}
  • Create a message listener
// Check every 1000ms (1s) for new messages
client.startMessageListener(1000, msgs => {
  console.log('Got some new message(s):\n', msgs);
});

// Stop the listener after 10s
setTimeout(client.stopMessageListener, 10000);

License

Apache 2.0

Keywords

temp-mail

FAQs

Package last updated on 10 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts