Détail du package

simujs

ludanadeodatus71MIT1.0.0

A simple JavaScript utility for identifying Tanzanian mobile network operators based on phone numbers, using prefix data regulated by TCRA.

tanzania, phone-number, mobile, operator

readme

SimuJS

📱 Identify Tanzanian mobile network operators by phone number.

SimuJS is a lightweight TypeScript utility that determines the mobile network operator (like Vodacom, Airtel, Tigo) from a Tanzanian phone number. It works based on the Tanzania Communications Regulatory Authority (TCRA) guidelines for phone number code allocations. This makes it ideal for applications involving user registration, telecom routing, mobile money flows, or analytics in the Tanzanian telecom sector.


📦 Installation

npm install simujs
# or
yarn add simujs

🔧 Usage

import { simu } from 'simujs';

const result = simu('0754123456');

console.log(result);
// {
//     name: Operators.Vodacom,
//     codes: ["74", "75", "76"],
//     company: "Vodacom Tanzania PLC",
//     financialService: "M-Pesa",
// }

✅ Supported Formats

  • +255754123456

  • 0754123456

  • 754123456

The number must be valid and belong to Tanzania (+255 country code). Invalid or foreign numbers return undefined.

🛠️ Built With

[google-libphonenumber](https://github.com/google/libphonenumber)

👤 Author

Adeodatus Ludan