phone-validate-vn
v0.0.6
Published
Library to validate Vietnamese phone number
Downloads
45
Maintainers
Readme
Vietnamese Phone number validation
Version: 0.0.1
API
Single api for every platform
validatePhone(phoneNumber:String, showReason:Boolean=true):String
Example:
validatePhone = chotot.validators.phone
console.log(validatePhone('(084)0935357942')); //=> "0935357942"
console.log(validatePhone('090.FACEBOOK.COM')); //=> "ERR_NON_DIGIT"
console.log(validatePhone('090.FACEBOOK.COM', false)) //=> ""
How to use
Client-side (browser)
- Checkout this project or (
npm install phone-validate-vn
) - Include
build/chotot.validators.phone.js
orbuild/chotot.validators.phone.min.js
. After that,window.chotot.validators.phone
function will be exported globally
Server-side
TBD!
Test
Please install mocha
and coffee-script
node packages globally (npm i -g mocha coffee-script
)
npm test