@jollie/risky-email
v1.0.12
Published
Check if email is risky (disposable provider or invalid DNS MX)
Downloads
4
Readme
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('[email protected]')
.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('[email protected]')
.then(() => console.log('Not risky'))
.catch(error => console.log(`Risky email : ${error.message}`);
// Valid email -> Output "Not risky"
isRiskyEmail('[email protected]')
.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