Skip to content

johno/is-phone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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).

About

Check whether a string is a valid phone number.

Resources

License

Stars

Watchers

Forks

Packages

No packages published