eri-js
v0.0.3
Published
ERIs companion. Intelligent e-mail address validation.
Downloads
2
Maintainers
Readme
ERI-js
Email Recipient Inspector is a project to help prevent email address typos. It requires a server component (https://github.com/Dynom/ERI).
A Quick hello world:
Except that it'll not actually output hello world ¯\_(ツ)_/¯
Install ERI-js
npm install eri-js
Client code
<script src="./node_modules/eri-js/eri-client.js" type="application/javascript"></script>
<script type="application/javascript">
window.addEventListener("DOMContentLoaded", () => {
const c = ERIClient.new({url: "http://localhost:1338"});
c.suggest("[email protected]", (result) => {
console.log(result);
});
});
</script>
Start backend
This will work fine on a mac on on linux, on Windows you'll need to either download the binary or compile it yourself.
docker run --rm -it -p "1338:1338" dynom/eri:latest --backend-driver=memory
On a fresh start ERI is empty (which is always the case with the memory driver), since it operates only on domains previously learned. So you'll need to feed it some data. This is actually very easy. First try a legitimate domain and then make a typo and see what it comes up with. E.g.:
[email protected]
(ERI validates the domain on the first request)[email protected]
(Here it should suggest[email protected]
)