is-phone
v2.0.0
Published
Check whether a string is a valid phone number.
Downloads
932
Maintainers
Readme
Is Phone
Check whether a string is a valid phone number. This uses test
rather than match
to ensure
it's as fast as possible: http://jsperf.com/regexp-test-vs-match-m5.
Installation
npm i --save is-phone
Usage
var isPhone = require('is-phone');
isPhone('invalid-phone-number') // => false
isPhone('123 456 7890') // => true
isPhone({}) // => throws TypeError
License
MIT
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Crafted with <3 by John Otander (@4lpine).