Excerpt here…

πŸπŸ‘‘πŸŒ

bold italic strikethrough

Get and install an NPM library

Get any email validator lib, such as https://github.com/manishsaraan/email-validator. Copy and paste it to a new javascript code vendor:email-validator. As it is an NodeJS lib, wrap it into a class:

[...]
var validator = new function(){
  this.validate = function(email){
    [...]
  }
}