Have ideas to improve npm?Join in the discussion! »

    is-phone-number

    1.0.4 • Public • Published

    is-phone-number

    check if string is a phone number

    Common use is server-side data validation as well. This module has no dependencies and is well tested.

    Install

    $ npm install --save is-phone-number

    Usage

    var isPhoneNumber = require('is-phone-number');
     
    isPhoneNumber('123-456-7890');
    //=> true
     
    isPhoneNumber('(123) 456-7890');
    //=> true
     
    isPhoneNumber('123 456 7890');
    //=> true
     
    isPhoneNumber('123.456.7890');
    //=> true
     
    isPhoneNumber('+91 (123) 456-78900');
    //=> true
     
    isPhoneNumber('5222-222-333');
    //=> false

    License

    MIT © Tejas Manohar

    Install

    npm i is-phone-number

    DownloadsWeekly Downloads

    185

    Version

    1.0.4

    License

    MIT

    Last publish

    Collaborators

    • avatar