Skip to content
This repository was archived by the owner on Apr 19, 2021. It is now read-only.
/ phoneparser Public archive
forked from gilshallem/phoneparser

Parse phone numbers into country code, area code, and number

License

Notifications You must be signed in to change notification settings

settlin/phoneparser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bloated & Deprecated

While it works, I will not recommend this. (Mind it, this is also not available at npm, so you have to use it from git directly).

Better option: Use https://github.com/halt-hammerzeit/libphonenumber-js via npm install libphonenumber-js. Cleaner, simpler and better.

PhoneParser

A very simple to use library that parse phone numbers into country code, area code, and number. It uses libphonenumber.

Here is a demo: https://rawgit.com/Gilshallem/phoneparser/master/demo.htm

Usage

  1. Download phoneparser.js
  2. Link the js file to your html or any other type of project.

Thats it!

Example

parsePhone("12025550104");

result: { countryCode:1, areaCode:202, number:5550104, countryISOCode:"US" }

ENJOY!! :)

About

Parse phone numbers into country code, area code, and number

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.8%
  • HTML 0.2%