mini-validator
v1.0.1
Published
mini size validator:For user login information validat only(username email password,confirmation,etc.)
Downloads
2
Readme
mini-validator
Mini-validator is a mini size validator for user login information validation. include username,password,email, data string validation and so on...
##Usage
###Install
npm install mini-validator
bower install mini-validator
Server
var validator=require("mini-validator");
Browser
<script type="text/javascript" src="path/mini-validator.min.js"></script>
##API
In server side ,if you define like "var validator=require("mini-validator");", you need use validator.isMaxLength(...); But in front-end side ,validator is a global object ,just validator.isMaxLength(...) is enough!
All return value is bool type:true for validate pass!
- isMaxLength(TestData,max_length,min_length=0)
- isMinLength(TestData,min_length)
- isNumber(TestData)
- isAlpha(TestData);
- isAlphaNumberWithDash(TestData);
- isAlphaNumber(TestData);
- isUrl(TestData);
- isEmail(TestData);