phone-number-lookup
Version:
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
44 lines (30 loc) • 1.21 kB
Markdown
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.
Use the package manager [npm](https://npmjs.com/) to install phone-number-lookup.
```bash
npm install phone-number-lookup
```
```typescript
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']);
```
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
[](https://choosealicense.com/licenses/mit/)