temp-email
v2.0.1
Published
API which allows to interact with disposable emails
Downloads
5
Maintainers
Readme
Install package by executing:
npm install temp-email --save
Declare package in sources
var TempEmail = require('temp-email');
To generate new email address:
Example:
var newEmail = TempEmail.generate();
console.log(newEmail); //[email protected]
To check email inbox:
Example:
TempEmail.getLastLetterText('[email protected]', { timeout: 10000 }).then(resp => {
console.log(`Success: ${resp}`);
}).catch(err => {
console.error(err);
});
If you are interested only in part of email then you may use css selector to filter response:
Example:
TempEmail.getLastLetterText('[email protected]', { timeout: 10000, cssSelector:'.verification-code'}).then(resp => {
console.log(`Success: ${resp}`);
}).catch(err => {
console.error(err);
});