commons-validator-js
JavaScript port of Apache Commons Validator.
Usage - npm
Install the library with npm install commons-validator-js
var EmailValidator = require('commons-validator-js').EmailValidator;
var validator = new EmailValidator();
validator.isValid('chuck.norris@gmail.com');
validator.isValid('chuck.norris@gmail.con');
Usage - bower
Install the library: bower install commons-validator-js
.
Add a reference: 'bower_components/commons-validator-js/dist/commons-validator-js.js'
Then use the global constructor: var EmailValidator = CommonsValidator.EmailValidator;
and proceed as shown in the npm usage example above.