Nigerian Phone Number Validator (JS)
Issues and pull requests welcome.
A JS package to validate and format a Nigerian phone number as well as deduce the network provider or area code.
Table of Contents
Installation
Install using npm: npm install validate_nigerian_phone
Install using yarn: yarn add validate_nigerian_phone
Usage
const NigerianPhone = ;const phone = '+2348135087966'; // Check if is validphone; // true // Get formattedphone; // 08135087966 // Get Networkphone; // mtn // Check if is mtnphone; // True // Get network from phone number prefix e.gphone; // mtn
Features
Currently implemented
- isValid
- formatted
- getNetwork
- getAreaCode
- isMtn
- isGlo
- isAirtel
- is9mobile
- isSmile
- isMultilinks
- isVisafone
- isNtel
- isStarcomms
- isZoom
- getPrefixesByNetwork
- getNetworkByPrefix
- getAreaCodeByName
Tests
Contribute
Check out the issues on GitHub and/or make a pull request to contribute!