README
node-validator
String validator for more.
Install
[sudo] npm install is-valid [--save]
Usage
var validator = require('is-valid');
validator.isEmail('abc@gmail.com'); // => true
Validators
- isEmail(str): check if it is an Email string
- isAllChinese(str): check if it is a string only contains Chinese characters
- isAllEnglish(str): check if it is a string only contains English characters
- isAllDigit(str): check if it is a string only contains digits
- isChineseTel(str): check if it is a Chinese cell-phone number
- isChineseIdCard(str): check if it is a 18-digit Chinese ID card number
- isVisaCard(str): check if it is a Visa card
- isMasterCard(str): check if it is a Master card
- isLink(str): check if it is a link
Test
git clone git@github.com:SFantasy/node-validator.git && cd node-validator
[sudo] npm install mocha -g
mocha
or
npm test
Coverage
npm test --coverage
License
The MIT License