Somalia (+252) phone validator, formatter, and operator guesser. Library + CLI.
# 🇸🇴 sophone
**Professional Somali phone number validation, formatting, operator detection & mobile wallet identification**
A comprehensive JavaScript/TypeScript library for working with Somali phone numbers. Validate, format, identify operators, and detect mobile money wallets (EVC, Sahal, ZAAD, eDahab, Jeeb) for Somalia (+252) phone numbers with beautiful error handling and TypeScript support.
## ✨ Features
- 🔍 **Validate** Somali phone numbers in any format
- 🎨 **Format** numbers to E.164, local, or international format
- 📱 **Identify operators** (Hormuud, Somtel, Telesom, etc.)
- đź’° **Detect mobile wallets** (EVC, Sahal, ZAAD, eDahab, Jeeb)
- 🛡️ **TypeScript support** with complete type definitions
- 🚀 **CLI tool** for command-line usage
- 📦 **Batch processing** for multiple numbers
- 🎯 **Beautiful error handling** with detailed messages
- ⚡ **Zero dependencies** and lightweight
## 📦 Installation
### For Library Use
```bash
npm install sophone
```
### For CLI Use (Global)
```bash
npm install -g sophone
```
## 🚀 Quick Start
### Basic Usage
```javascript
import {
isValidSomaliMobile,
normalizeE164,
formatLocal,
getOperator,
getWallet,
getWalletInfo,
} from "sophone";
// Validate any Somali phone number format
isValidSomaliMobile("+252 61 123 4567"); // âś… true
isValidSomaliMobile("0611234567"); // âś… true
isValidSomaliMobile("611234567"); // âś… true
isValidSomaliMobile("252611234567"); // âś… true
isValidSomaliMobile("invalid"); // ❌ false
// Convert to international E.164 format
normalizeE164("0611234567"); // "+252611234567"
// Format for local display
formatLocal("+252611234567"); // "0611 234 567"
// Identify the mobile operator
getOperator("0611234567"); // "Hormuud"
// Identify the mobile wallet
getWallet("0611234567"); // "EVC"
getWallet("0621234567"); // "Sahal"
getWallet("0631234567"); // "ZAAD"
// Get detailed wallet information
const walletInfo = getWalletInfo("0611234567");
console.log(walletInfo.name); // "EVC Plus"
console.log(walletI …