ug-phone
v1.0.4
Published
Determine which service provider a Ugandan phone number belongs to and check validity of Ugandan phone numbers
Downloads
15
Maintainers
Readme
ug-phone
Check Validity and Service Providers of Ugandan phone numbers
Installation
Use the node package manager npm to install ug-phone.
npm install ug-phone
Usage
Include in your project
ES5
const ugPhone = require("ug-phone");
ES6
import ugPhone from "ug-phone";
Check if phone number is in valid Ugandan format
ugPhone.isUgandanNumber("0755128879");
// returns true
Get network service provider of a given phone number
ugPhone.getUgandanProvider("+256755128879");
// returns Airtel
Valid number criteria
- Begins with
2567
or07
or+2567
followed by exactly 8 digits
Valid number examples
- 07712345678
- +256712345678
- 256712345678
Available service providers
- Airtel
- MTN
- Africell
- Uganda Telecom
- Lycamobile
- Smile Telecom
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.