Logo Lanfrica

omartood/sophone

Domain:

digital infrastructure

Record type:

softwaretools
Creator:
oma
Host:
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 …

Languages

Licenses