Skip to content

Ewan-Reveille/phone-country-lookup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phone-country-lookup-ts

phone-country-lookup-ts is a server-side tool that helps you detect the country of origin of a phone number and verify if it has the correct digit count. It is the TypeScript version of phone-country-lookup

Installation

To install phone-country-lookup-ts, use npm:

npm install phone-country-lookup-ts

Usage

import {checkPhoneNumber} from 'phone-country-lookup-ts';
const phoneNumber = "+998901237";
const result = checkPhoneNumber(phoneNumber);

if (result && typeof result === "object") {
  console.log(`The corresponding country of the telephone area code ${result.identifier} is: ${result.country}. The number of figures is ${result.isCorrectNumber}.`);
} else {
  console.log(`No country matches the telephone area code ${phoneNumber}`);
}

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Server-side tool for detecting a phone number's origin country and verifying the correct digit count.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published