phone-formater-ke
v2.1.2
Published
Format Kenyan Phone Numbers and Check MVNO/ISP under the number
Downloads
6
Maintainers
Readme
KE Phone Number formatter
This is a simple package to assist in formatting Kenyan phone numbers and also auto selecting the ISP the number belongs to.
Installing via npm
npm install --save [email protected]
Replace x.x.x
with the current version
Via CDN
- Coming soon
Usage
const { checkOperator, FormatNumbers } = require('../Support/PhoneFormatter');
/**
* Format phones
* Format phone number
* pass any number here for any phone number/provider in Kenya
*/
let formatted_phone = FormatNumbers("0711123123") // pass number as a string,
console.log(formatted_phone) // will show 254711123123
let formatted_phone = FormatNumbers("711123123") // pass number as a string
console.log(formatted_phone) // will show 254711123123
Find ISP/MVNO
/**
* pass any number here for any phone number/provider in Kenya
* Supported providers
* Safaricom KE
* Airtel KE
* Telkom KE
* Equitel KE
* Faiba4g/Jamii Telkom
*
*/
let isp = checkOperator("0711123123") // pass number as a string
console.log(isp) // will show Safaricom
let isp2 = checkOperator("0733123123")
console.log(isp2) // will show Airtel
...
Contributions
PLease submit your contributions as PRs and also leave a good description for the PR.
Coffee?
Support me by subscribing my YouTube Channel to also learn more
Licenses
This code is licenced under MIT. Feel free to use, distribute, sell or modify. No warranties or guarantees are offered by the same.