is_email for JavaScript, Node, RequireJS and jQuery

These days, almost every website asks for an email address when you sign up for their services. But have you ever wondered how they actually validate those inputs? More often than not, they use hasty regex snippets that completely ignore official RFC standards.

This creates a frustrating problem. Sometimes, an ISP issues an email address that technically flouts strict RFC conventions. But if you can successfully send and receive emails on it, why should a signup form block you just because its validation script thinks it’s “invalid”?

To solve this properly, Dominic Sayers originally developed a brilliant library called is_email (available in Java, C#, and PHP) that handles robust, real-world email validation against the actual standards.


Recently, I had a project requirement where I needed to validate email addresses heavily on the frontend using JavaScript. I spent hours trying out various JS libraries available on the web, but honestly, I failed to find a single one that matched the accuracy and depth of Dominic’s is_email validator.

Since what I needed didn’t exist, I decided to build it. I sat down and personally ported the entire PHP codebase of is_email over to JavaScript.

Use It Anywhere (Node.js, Browser, and More)

I’ve shared the project on GitHub in the hope that someone out there facing the exact same issue can save themselves a few hours of digging.

To make it as flexible as possible, the library supports multiple environments:

You can find all the implementation details, installation steps, and code snippets directly in the README.md file on the Github repository.

This is an open-source, so if you end up using it and run into any bugs, please open an issue on GitHub. Or better yet, feel free to fork the repo and send over a pull request!

2 Comments

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.