vanilla-validation
Vanilla JavaScript validation rules
Usage
Install from npm:
npm install --save vanilla-validation
Use in project:
// get vanilla-validation from node_modules
const vRules = require('vanilla-validation');
// log vRules to see all rules available
console.log(vRules);
<input type="email" id="email" value="test@example.com">
// get email element
var emailElm = document.getElementById('email');
// test if element contains valid email
vRules.vrule_email(emailElm)