phoneformat

phoneformat as a Bower package


Keywords
phoneformat
License
MIT
Install
bower install phoneformat

Documentation

PhoneFormat

This is a copy of albeebe/phoneformat.js with the following changes:

  • This is a Bower package
  • Website is not a part of the repository
  • Updating is as simple as typing make (assuming curl is installed)
  • Exposed getNumberType(country, phone) to return the type of the phone number (mobile, landline, toll free, etc.)

Install

bower install phoneformat

Use

Reference phoneformat.min.js from your project.

Available functions:

  • countryForE164Number(phone)
  • formatNumberForMobileDialing(country, phone)
  • isValidNumber(phone, country)
  • formatE164(country, phone)
  • formatInternational(country, phone)
  • formatLocal(country, phone)
  • cleanPhone(phone)
  • countryCodeToName(country)

All of the above are subject to change in future versions.

Todo

  • AMD
  • Better API