Notoriously Pedantic Magistrate

    phone-validate-vn

    0.0.6 • Public • Published

    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)

    1. Checkout this project or (npm install phone-validate-vn)
    2. Include build/chotot.validators.phone.js or build/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

    Install

    npm i phone-validate-vn

    DownloadsWeekly Downloads

    0

    Version

    0.0.6

    License

    ISC

    Last publish

    Collaborators

    • tungv