2.0.0 • Published 9 years ago

is-phone v2.0.0

Weekly downloads
171
License
MIT
Repository
github
Last release
9 years ago

Is Phone

Build Status

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Crafted with <3 by John Otander (@4lpine).