Skip to content

node-js API for maildrop.cc (email e2e test automation)

Notifications You must be signed in to change notification settings

hedcet/maildrop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-js API for maildrop.cc

helper APIs to fetch mail objects from https://maildrop.cc

install

with npm do:

npm install --save @maildrop/api

usage

for basic test

const mails = await maildrop.fetchMails("[email protected]");
console.log(`${mails.length || "zero"} mails`);

for (const mail of mails)
  console.log(`==========\n${JSON.stringify(mail, null, 2)}\n==========`);
async fetchMails(email)

fetch mails @return Object[] like this { id, from, to, subject, date, body, html }[]

opt type description
email String [required] sample [email protected]
{
  "id": "HrYSsdRcRA",
  "from": "Linto Cheeran <[email protected]>",
  "to": "linto",
  "subject": "subject",
  "date": "2020-04-08T21:47:13Z",
  "body": "raw email body",
  "html": "html body"
}
async deleteMail(email, id)

delete individual mail @return [Object] { deleted: true }

opt type description
email String [required] sample [email protected]
id String [required] individual mail object id
for (const mail of mails)
  console.log(await maildrop.deleteMail("[email protected]", mail.id));
async getApiKey(force)

return String x-api-key, you can use this in http header

opt type description
force Boolean [optional] for forceful refresh

Releases

No releases published

Packages

No packages published