humphd / phoneparser-js

Using Google libphonenumber with JS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

phoneparser-js

Using Google libphonenumber with JS

This is a Node.js app that uses libhphonenumber library to parse phone numbers.
Before you proceed, please ensure that you have downloaded and installed Node.js from nodejs.org.

How to use

  • Download this repo
  • Navigate inside it with command-line, and install all the packages:
npm install
  • Run the server by typing:
npm run dev

It should show you the following:
LAUNCH

Now you can access the API endpoints. To do that, you can use Fiddler or Postman. The screenshots below capture work process on Postman and results.

GET

As of now, GET works only with one number.
Url to test: localhost:8000/api/phonenumbers/parse/text/testparser+14445556677
Make sure you have GET as request method and included "application/json" for "Content-Type" before sending request: GET

POST

Url to test: localhost:8000/api/phonenumbers/parse/file
Make POST as request method, change "Content-Type" to "multipart/form-data", and include the file before sending request:

Header

POST1

Entity body

POST2

TESTING

First, make sure your server is not running because it will prevent tests from running.
Assuming you are still in the root of project, run this command:

npm test

It will show you the following in the command-line:
TESTS

ISSUES

Please navigate to Issues page at the top of repo.

About

Using Google libphonenumber with JS

License:MIT License


Languages

Language:JavaScript 100.0%