for internal use only - Draft idea to check trustworthiness of email account
risky-email
Check if email is from disposable provider or has no DNS MX record
Install
yarn add @jollie/risky-email
or
npm install @jollie/risky-email
Usage
const isRiskyEmail = require('@jollie/risky-email');
// Diposable email
// Output "Risky email : Disposable email address"
isRiskyEmail('contact@yopmail.com')
.then(() => console.log('Not risky'))
.catch(error => console.log(`Risky email : ${error.message}`);
// Non-existent domain
// Output "Risky email : queryMx ENOTFOUND he-llo-w-orld.com"
isRiskyEmail('contact@he-llo-w-orld.com')
.then(() => console.log('Not risky'))
.catch(error => console.log(`Risky email : ${error.message}`);
// Valid email -> Output "Not risky"
isRiskyEmail('contact@google.com')
.then(() => console.log('Not risky'))
.catch(error => console.log(`Risky email : ${error.message}`);
Return value
Promise resolved with the email or rejected if risky email