@jollie/unsafe-email
v1.1.0
Published
Check if email is unsafe (disposable provider or invalid DNS MX)
Downloads
1
Readme
for internal use only - Draft idea to check trustworthiness of email account
unsafe-email
Check if email is from disposable provider or has no DNS MX record
Install
yarn add @jollie/unsafe-email
or
npm install @jollie/unsafe-email
Usage
const isTricky = require('@jollie/unsafe-email');
// Diposable email
// Output "Unsafe email : Disposable email address"
isTricky('[email protected]')
.then(() => console.log('Looks good'))
.catch(error => console.log(`Unsafe email : ${error.message}`);
// Non-existent domain
// Output "Unsafe email : queryMx ENOTFOUND he-llo-w-orld.com"
isTricky('[email protected]')
.then(() => console.log('Looks good'))
.catch(error => console.log(`Unsafe email : ${error.message}`);
// Valid email -> Output "Looks good"
isTricky('[email protected]')
.then(() => console.log('Looks good'))
.catch(error => console.log(`Unsafe email : ${error.message}`);
Return value
Promise resolved with the email or rejected if unsafe email