validator-ponsel
v1.0.10
Published
Melakukan validasi nomor ponsel
Downloads
45
Readme
Validator Ponsel
A small tool to lookup a string and identify it as a valid Indonesian mobile operator.
Available Mobile Operators
Install
npm install validator-ponsel
Usage
const ponsel = require('validator-ponsel');
const nomorAxis = ponsel('0838 1234 5678');
console.log(nomorAxis); // will result axis
const nomorIndosat = ponsel('0816 1232 5678');
console.log(nomorIndosat); // will result indosat
const nomorSmartfren = ponsel('0888 1234 5678');
console.log(nomorSmartfren); // will result smartfren
const nomorTelkomsel = ponsel('0812 1234 5678');
console.log(nomorTelkomsel); // will result telkomsel
const nomorThree = ponsel('0899 1234 5678');
console.log(nomorThree); // will result three
const nomorXl = ponsel('0817 1234 5678');
console.log(nomorXl); // will result xl
Moving Forward
- I'm very opened for feedback on detection pattern, specially the number of digits
- Also will be interesting if this library can be extended to detect mobile operators from other countries based on the string's format. Contributors wanted!
License
MIT