phone-formater-ke
Version:
Format Kenyan Phone Numbers and Check MVNO/ISP under the number
66 lines (48 loc) • 1.84 kB
Markdown



This is a simple package to assist in formatting Kenyan phone numbers and also auto selecting the ISP the number belongs to.
```npm install --save phone-formatter-ke@x.x.x```
Replace ```x.x.x``` with the current version
* Coming soon
```js
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
```
```js
/**
* 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
...
```
PLease submit your contributions as PRs and also leave a good description for the PR.
Support me by subscribing my YouTube Channel to also learn more
[](https://www.youtube.com/channel/UCir9WqT_YkTy9zoh-AopByg?sub_confirmation=1)
This code is licenced under MIT. Feel free to use, distribute, sell or modify. No warranties or guarantees are offered by the same.