New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

1secmail-api

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

1secmail-api

A Node API for 1secmail.com

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1K
increased by5.8%
Maintainers
1
Weekly downloads
 
Created
Source

1secmail-api

A NodeJS API for 1secmail.com

Examples and usage

The below example creates an email account at exampleAccount@1secmail.com and fetches emails every 10 seconds.

const { TempMail } = require("1secmail-api");

// Create email account
const mail = new TempMail("exampleAccount");

// Enable auto-fetching full emails
mail.autoFetch();

// Wait until the client is ready
mail.onReady(() => {
  // Should show: exampleAccount@1secmail.com
  console.log("Email ready! Address:", mail.address);

  // Get emails every 10 seconds
  const fetch = () => {
    mail.getMail().then((mails) => {
      console.log(mails);

      mail.deleteMail();
    });
  };

  fetch();
  setInterval(fetch, 10 * 1000);
});

You can also chose different domains by passing an extra argument to the TempMail constructor:

// john@esiix.com
const mail = new TempMail("john", "esiix.com");

To generate random email addresses use mail

mail.getRandomAddress();

To download an attachment use mail.getAttachment(id, file) and pass the email ID and the file name.

Keywords

FAQs

Package last updated on 26 Jun 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc