is-phone-number
v1.0.4
Published
check if string is a phone number
Downloads
138
Maintainers
Readme
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