1.0.1 • Published 7 months ago

minuteinbox.js v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

MinuteInbox.JS

Unofficial javascript wrapper for minuteinbox.com

💻 Description

Create temporary e-mails and receive e-mails with MinuteInbox through python! It also parses the E-Mail Address MinuteInbox created for you, so you can directly access last and first name. 🎉

🎉 Usage

You'll be able to use this, just as in the following example:

const MinuteInbox = require("./index");
const { getContent } = require("./api");

const checkEmails = async (inbox) => {
  console.log("Start checking ...");
  // fetch all emails in the inbox
  for (let mail of await inbox.getMails()) {
    console.log("\tFROM:", mail.sender.name, mail.sender.address);
    console.log("\tSUBJECT:", mail.subject);
    console.log("\tSENT AT:", mail.sent_at);
    console.log("\tIS NEW:", mail.is_new);
    console.log();
    if (mail.is_new) await getContent(address, token, mail.id);
  }

  setTimeout(() => {
    checkEmails(inbox);
  }, 3000);
};

const main = async () => {
  // use without parameters to create a new inbox
  const inbox = await MinuteInbox.build();

  // use with address and token to reuse an existing inbox
  // const inbox = new MinuteInbox(
  //   "crockett.cainen@my2ducks.com",
  //   "66a5c5b8d3384454dd88e381fcbfdfc0"
  // );

  address = inbox.address;
  token = inbox.token;

  console.log(address, "(", token, ")");

  // extend the expiration of the inbox by 10 minutes
  inbox.extend_10m();

  console.log("Expires in:", await inbox.expires_in(), "seconds");

  checkEmails(inbox);
};

main();

⚠️ Disclaimer

I'm not associated in any way with MinuteInbox.com, if requested by them I will take down this repository. In this case please prove your Identity and send me an E-Mail. You can check my profile to find it.

🤝 Support


⚡️Stay awesome!⚡️

1.0.1

7 months ago

1.0.0

7 months ago