*TL;DR-*
commons-validator-js <https://github.com/wix/commons-validator-js> is a
partial JavaScript port of commons-validator (currently EmailValidator and
DomainValidator).

*Long version-*
commons-validator's EmailValidator is by far the best and most
comprehensive email validator out there.

Unfortunately, there's no equivalent JavaScript implementation.
Specifically, I couldn't find a JavaScript email validation library that A)
works offline, and B) validates top level domains (e.g. fails
"[email protected]").

Introducing: commons-validator-js, a JavaScript version of EmailValidator
and DomainValidator, each accompanied by a complete test case.

The only challenge was working around some issues with JavaScript's regexp
implementation, e.g. no support for lookbehind or "\p{...}". Eventually I
commented-out 2-3 tests that still fail, but these were edge cases that
didn't really bother me.

Reply via email to