1.0.4 • Published 2 years ago
ug-phone v1.0.4
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-phoneUsage
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 trueGet network service provider of a given phone number
ugPhone.getUgandanProvider("+256755128879");
// returns AirtelValid number criteria
- Begins with
2567or07or+2567followed 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.