npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mm-tel-validator

v1.0.2

Published

Myanmar phone number validator with operator detection, network type identification, and brand information.

Readme

mm-tel-validator

Myanmar phone number validator with operator detection, network type identification, and brand information. Supports both JavaScript and TypeScript.

Live Demo

Try it online: https://mm-phone-number-check.vercel.app

Features

  • Real-time Validation - Validate Myanmar phone numbers instantly
  • Operator Detection - Identify telecom operators (Ooredoo, Telenor, MPT, MyTel, MEC)
  • Network Type Detection - Determine network type (GSM, WCDMA, CDMA 450 MHz, CDMA 800 MHz)
  • Myanmar Numeral Support - Accepts both Arabic (0-9) and Myanmar (၀-၉) numerals
  • Multiple Format Support - Handles local (09...), international (+959...), and various formats
  • Operator Brand Info - Get operator colors, labels, and icons for UI styling
  • Batch Validation - Validate multiple phone numbers at once
  • TypeScript Support - Full TypeScript types included
  • Dual Module Format - Supports both CommonJS and ESM

Installation

npm install mm-tel-validator

Usage

JavaScript (CommonJS)

const {
  validatePhoneNumber,
  isValidMMPhoneNumber,
  getTelecomName,
  getPhoneNetworkType,
  OPERATORS,
} = require("mm-tel-validator");

// Validate a phone number
const result = validatePhoneNumber("09977889900");
console.log(result);
// {
//   isValid: true,
//   phoneNumber: '09977889900',
//   operator: 'Ooredoo',
//   operatorLabel: 'U9',
//   operatorColor: '#e11d48',
//   operatorIcon: '🔴',
//   networkType: 'GSM'
// }

// Check if valid
const isValid = isValidMMPhoneNumber("09977889900");
console.log(isValid); // true

// Get operator name
const operator = getTelecomName("09977889900");
console.log(operator); // 'Ooredoo'

// Get network type
const networkType = getPhoneNetworkType("09977889900");
console.log(networkType); // 'GSM'

TypeScript / ESM

import {
  validatePhoneNumber,
  isValidMMPhoneNumber,
  getTelecomName,
  getPhoneNetworkType,
  OPERATORS,
  type ValidationResult,
  type OperatorName,
  type NetworkType,
} from "mm-tel-validator";

// Validate a phone number
const result: ValidationResult = validatePhoneNumber("09977889900");

console.log(result);
// {
//   isValid: true,
//   phoneNumber: '09977889900',
//   operator: 'Ooredoo',
//   operatorLabel: 'U9',
//   operatorColor: '#e11d48',
//   operatorIcon: '🔴',
//   networkType: 'GSM'
// }

// Get operator name
const operator: OperatorName = getTelecomName("09977889900");
console.log(operator); // 'Ooredoo'

// Get network type
const networkType: NetworkType = getPhoneNetworkType("09977889900");
console.log(networkType); // 'GSM'

React Example

import { validatePhoneNumber, OPERATORS } from "mm-tel-validator";

function PhoneInput({ phoneNumber }: { phoneNumber: string }) {
  const result = validatePhoneNumber(phoneNumber);

  if (!result.isValid) {
    return <div>Invalid phone number</div>;
  }

  return (
    <div style={{ color: result.operatorColor }}>
      {result.operatorIcon} {result.operator} - {result.networkType}
    </div>
  );
}

Batch Validation

Validate multiple phone numbers at once with summary statistics.

const { validateMultiple } = require("mm-tel-validator");

const phoneNumbers = ["09977889900", "0977889900", "0961234567", "invalid"];
const results = validateMultiple(phoneNumbers);

console.log(results);
// {
//   total: 4,
//   valid: 3,
//   invalid: 1,
//   results: [
//     {
//       isValid: true,
//       phoneNumber: '09977889900',
//       operator: 'Ooredoo',
//       operatorLabel: 'U9',
//       operatorColor: '#e11d48',
//       operatorIcon: '🔴',
//       networkType: 'GSM',
//       original: '09977889900'
//     },
//     {
//       isValid: true,
//       phoneNumber: '0977889900',
//       operator: 'MPT',
//       operatorLabel: 'MPT',
//       operatorColor: '#0ea5e9',
//       operatorIcon: '🔵',
//       networkType: 'GSM',
//       original: '0977889900'
//     },
//     {
//       isValid: true,
//       phoneNumber: '09682345677',
//       operator: 'MyTel',
//       operatorLabel: 'MyTel',
//       operatorColor: '#7c3aed',
//       operatorIcon: '🟣',
//       networkType: 'GSM',
//       original: '09682345677'
//     },
//     {
//       isValid: false,
//       phoneNumber: 'invalid',
//       original: 'invalid'
//     }
//   ]
// }

// Filter only valid numbers
const validNumbers = results.results.filter((r) => r.isValid);

// Get summary
console.log(`Valid: ${results.valid}/${results.total}`);
import { validateMultiple, type BatchValidationResult } from "mm-tel-validator";

const results: BatchValidationResult = validateMultiple([
  "09977889900",
  "0977889900",
  "0961234567",
]);

console.log(
  `Validated ${results.total} numbers: ${results.valid} valid, ${results.invalid} invalid`,
);

Supported Operators

| Operator | Code | Prefix | Color | Icon | | -------- | ------- | ----------------- | ---------- | ---- | | Ooredoo | U9 | 099xxxxxxx | 🔴 #e11d48 | 🔴 | | Telenor | Telenor | 097xxxxxxx | 🔴 #0ea5e9 | 🔴 | | MPT | MPT | Multiple prefixes | 🟡 #f59e0b | 🟡 | | MyTel | MyTel | 096xxxxxxx | 🟣 #7c3aed | 🟣 | | MEC | MEC | 093xxxxxxx | 🟢 #22c55e | 🟢 |

Supported Formats

09XXXXXXXX
+959XXXXXXXX
959XXXXXXXX
09-XXX-XXXX
09 XXX XXXX
၀၉XXXXXXXX (Myanmar numerals)

API Reference

validatePhoneNumber(phoneNumber: string): ValidationResult

Complete phone number validation with all details.

Returns:

  • isValid - Whether the phone number is valid
  • phoneNumber - Normalized phone number
  • operator - Operator name (Ooredoo, Telenor, MPT, MEC, MyTel, Unknown)
  • operatorLabel - Operator label for display
  • operatorColor - Operator brand color (hex)
  • operatorIcon - Operator icon emoji
  • networkType - Network type (GSM, WCDMA, CDMA 450 MHz, CDMA 800 MHz, Unknown)

isValidMMPhoneNumber(phoneNumber: string): boolean

Check if phone number is valid Myanmar format.

getTelecomName(phoneNumber: string): OperatorName

Get operator name for a phone number.

getPhoneNetworkType(phoneNumber: string): NetworkType

Get network type for a phone number.

normalizeInput(phoneNumber: string): string

Normalize phone number (convert Myanmar numerals, standardize format).

sanitizeInput(phoneNumber: string): string

Sanitize phone number (remove spaces, dashes, fix country codes).

getOperatorConfig(operatorName: string): OperatorBrand

Get operator brand configuration.

Constants

  • OPERATORS - All operator brand configurations
  • NETWORK_TYPE - All network type constants

Type Definitions

interface ValidationResult {
  isValid: boolean;
  phoneNumber: string;
  operator?: OperatorName;
  operatorLabel?: string;
  operatorColor?: string;
  operatorIcon?: string;
  networkType?: NetworkType;
}

type OperatorName = "Ooredoo" | "Telenor" | "MPT" | "MEC" | "MyTel" | "Unknown";

type NetworkType =
  | "GSM"
  | "WCDMA"
  | "CDMA 450 MHz"
  | "CDMA 800 MHz"
  | "Unknown";

interface OperatorBrand {
  name: string;
  label: string;
  color: string;
  gradient: string;
  icon: string;
}

License

MIT License - Feel free to use this tool for personal or commercial projects.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgments

  • Built for the Myanmar community
  • Supports all major telecom operators in Myanmar
  • Free and open-source