Checkjs is a simple Javascript library for validating your data. Currently it supports URL, Number, US Phone Number, Credit Card Number, Email and US Zip Code.
<script src="checkjs.min.js"></script>
Checkjs.validate(data, callback);
data {Object} - The data and rule you want to validate
callback A callback function with result and error messege if any
var data_object = {
data: 'johndoe@gmail.com',
rule: "Email"
};
Checkjs.validate(data_object, function(result, messege){
console.log(result +" "+messege)
});
Currently Checkjs accepts and validates against only 6 rules. []
This rule validates data for valid Url formate as http://google.com.
This rule checks weather data is number or not.
This rule validates data for valid email address.
This rule check weather given data is in correct US phone number format or not.
####ZipCode
This rule check weather given data is in correct US zip code format or not.
This rule check for valid credit card number format.
##Refernces For library skeleton.
For regular expression refernce
Checkjs is distributed under the MIT license.