String validator for more.
[sudo] npm install is-valid [--save]
var validator = require('is-valid');
validator.isEmail('[email protected]'); // => true
- 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
git clone [email protected]:SFantasy/node-validator.git && cd node-validator
[sudo] npm install mocha -g
mocha
or
npm test
npm test --coverage
The MIT License