is-valid

1.1.0 • Public • Published

node-validator

String validator for more.

NPM version build status Coveralls Status David deps

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

Package Sidebar

Install

npm i is-valid

Weekly Downloads

2

Version

1.1.0

License

MIT

Last publish

Collaborators

  • fantasyshao