phone-number-lookup
v1.0.8
Published
phone-number-lookup is TS written library that provides information about a phone number, such as: Country, Prefix, Type (Mobile/Fixed/VoIP), Carrier etc. Every data is processed locally, so no internet connection is needed. Made primarily for personal-us
Downloads
9
Maintainers
Readme
phone-number-lookup
phone-number-lookup is TS written library that provides information about a phone number, such as: Country, Prefix, Type (Mobile/Fixed/VoIP), Carrier etc. Every data is processed locally, so no internet connection is needed. Made primarily for personal-use.
Installation
Use the package manager npm to install phone-number-lookup.
npm install phone-number-lookup
Usage
import { convertToE164, validateE164, phoneLookup } from 'phone-number-lookup';
/*
* takes a phone number with a proper country code
* returns a phone number on the E164 format (+3556723345293)
*/
convertToE164('355-(67)23-345-293');
/*
* takes a phone number with a proper country code
* returns true if the number is in the E164 format, and false if not
*/
validateE164('355-(67)23-345-293');
/*
* takes an array of phone numbers on E164 format
* returns information found about those numbers
*/
phoneLookup(['+3556723345293', '+34556777654']);
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.