Skip to content

Commit

Permalink
Added node code
Browse files Browse the repository at this point in the history
  • Loading branch information
andreis committed Jun 3, 2016
1 parent 6365709 commit 54dc169
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.generate
disposable.go
domains.txt
README.md
15 changes: 15 additions & 0 deletions disposable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

var domainMap = {};
for (let d of require('./domains')) {
domainMap[d] = null;
}

module.exports = {
validate: (domain, callback) => {
if (!callback) {
return domainMap.hasOwnProperty(domain);
}
callback(null, domainMap.hasOwnProperty(domain));
}
}
26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "disposable-email",
"version": "0.1.0",
"description": "Disposable email domains",
"main": "disposable.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/andreis/disposable.git"
},
"keywords": [
"email",
"disposable",
"temporary",
"validation",
"mail"
],
"author": "Andrei Simionescu <ansimionescu@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/andreis/disposable/issues"
},
"homepage": "https://github.com/andreis/disposable#readme"
}

0 comments on commit 54dc169

Please sign in to comment.