email-checkup
Advanced tools
Comparing version 0.8.0 to 1.0.0
33
index.js
const config = require("./config.json"); | ||
const fetch = require("node-fetch"); | ||
@@ -11,3 +12,8 @@ module.exports = async function(options) { | ||
const isDomainTrue = await checkDomain(checkArobase[1], options); | ||
return isDomainTrue; | ||
if(!options.exists || options.exists != true) return isDomainTrue; | ||
else{ | ||
const deliverable = await exists(mail); | ||
return deliverable; | ||
} | ||
}else return false; | ||
@@ -25,2 +31,27 @@ }else return false; | ||
return true; | ||
} | ||
function exists(mail){ | ||
const url = `https://api.trumail.io/v2/lookups/json?email=${mail}` | ||
const authParams = { | ||
headers:{ | ||
'Host': 'api.trumail.io', | ||
'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0', | ||
'Accept': 'text/plain, */*; q=0.01', | ||
'Accept-Language': 'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3', | ||
'Accept-Encoding': 'gzip, deflate, br', | ||
'Origin': 'https://trumail.io', | ||
'Connection': 'keep-alive', | ||
'Referer': 'https://trumail.io/', | ||
'TE': 'Trailers' | ||
} | ||
} | ||
return new Promise(async resolve => { | ||
fetch(url, authParams).then(res => { | ||
res.json().then(data => { | ||
resolve(data.deliverable); | ||
}) | ||
}) | ||
}) | ||
} |
{ | ||
"name": "email-checkup", | ||
"version": "0.8.0", | ||
"_from": "email-checkup", | ||
"_id": "email-checkup@0.8.0", | ||
"_inBundle": false, | ||
"_integrity": "sha512-G4LAki1u5H9oYBt8vHxYz4Ex54BKiISSsVYpOmaeyWqyOgT/5PzT+b/9aisWwMhBKkbV2KUrojSZ1o11JRrqAg==", | ||
"_location": "/email-checkup", | ||
"_phantomChildren": {}, | ||
"_requested": { | ||
"type": "tag", | ||
"registry": true, | ||
"raw": "email-checkup", | ||
"name": "email-checkup", | ||
"escapedName": "email-checkup", | ||
"rawSpec": "", | ||
"saveSpec": null, | ||
"fetchSpec": "latest" | ||
}, | ||
"_requiredBy": [ | ||
"#USER", | ||
"/" | ||
], | ||
"_resolved": "https://registry.npmjs.org/email-checkup/-/email-checkup-0.8.0.tgz", | ||
"_shasum": "313896d4c142eca761a4b9be05e11198013fda82", | ||
"_spec": "email-checkup", | ||
"_where": "/home/pierre/Bureau/Intact Zone", | ||
"author": { | ||
"name": "Pioupia" | ||
}, | ||
"bundleDependencies": false, | ||
"deprecated": false, | ||
"description": "A email verification package. Disposable email filter and verifies that the email exists.", | ||
"main": "index.js", | ||
"keywords": [ | ||
@@ -12,11 +38,16 @@ "emailchecker", | ||
], | ||
"author": "Pioupia", | ||
"license": "MIT", | ||
"main": "index.js", | ||
"name": "email-checkup", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://https://github.com/pioupia/email-checkup.git" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://https://github.com/pioupia/email-checkup.git" | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"node-fetch": "^2.6.1" | ||
} | ||
} |
@@ -24,3 +24,4 @@ # email-checkup | ||
blacklist: false, //by default is true. | ||
whitelist: ["com", "be", "ch", "fr"] //By default is ["com", "be", "ch", "fr"] | ||
whitelist: ["com", "be", "ch", "fr"], //By default is ["com", "be", "ch", "fr"] | ||
exists: true //by default is false. | ||
}).then(result => { | ||
@@ -35,5 +36,6 @@ console.log(result) // Return "true" if the email is real. And return "false" if the email is not real Warning, the package does not check if the email exists (for now)! | ||
* *blacklist* - _true / false_ (Defaults to true). This option is optional. It enables a blacklist of more than 360 disposable email sites. | ||
* *whitelist* - _array_ (Defaults : ["com", "be", "ch", "fr"]). This option is optional. It enables a whitelist of all domains accepted in the email. | ||
* *mail* - _email_ (This option is not optional !). Put the email to check. | ||
* **blacklist** - _true / false_ (Defaults to true). This option is optional. It enables a blacklist of more than 360 disposable email sites. | ||
* **whitelist** - _array_ (Defaults : ["com", "be", "ch", "fr"]). This option is optional. It enables a whitelist of all domains accepted in the email. | ||
* **mail** - _email_ (This option is not optional !). Put the email to check. | ||
* **exists** - _true / false_ (Defaults to false). This option allows you to check if the email exists ! | ||
@@ -40,0 +42,0 @@ ## Contributing |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
10924
394
2
46
1
1
+ Addednode-fetch@^2.6.1
+ Addednode-fetch@2.7.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)