Skip to content

πŸ“ž Unlock the power of this TypeScript library! It's your go-to toolkit for validating and extracting insights from Myanmar phone numbers. πŸ‡²πŸ‡²πŸ”

Notifications You must be signed in to change notification settings

minmyatoo/myanmar-phone-number-validator-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

39 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ž Myanmar Phone Number Validator πŸ‡²πŸ‡²

Validate and decode Myanmar phone numbers with ease using this TypeScript library! It's an evolution of the original JavaScript library by Kaung Myat Lwin, now enhanced to fully support TypeScript. πŸš€

Installation πŸ“¦

To install this package, simply run:

npm install myanmar-phone-number-validator

Usage πŸ› οΈ

This package offers a myanmarPhoneNumber object packed with helpful functions:

  • isValidMMPhoneNumber(phoneNumber: string): boolean: Verifies if a string is a valid Myanmar phone number, returning true for valid and false for invalid numbers.
import { myanmarPhoneNumber } from 'myanmar-phone-number-validator';

const phoneNumber = '0949880111';
if (myanmarPhoneNumber.isValidMMPhoneNumber(phoneNumber)) {
    // It's a valid phone number!
} else {
    // Oops, invalid phone number!
}
  • getTelecomName(phoneNumber: string): string: Retrieves the name of the telecom operator associated with a phone number, or "Unknown" if it can't be determined.
import { myanmarPhoneNumber } from 'myanmar-phone-number-validator';

const phoneNumber = '0949880111';
const telecomName = myanmarPhoneNumber.getTelecomName(phoneNumber);
  • getPhoneNetworkType(phoneNumber: string): string: Determines the network type of a phone number, returning "Unknown" if it can't be determined.
import { myanmarPhoneNumber } from 'myanmar-phone-number-validator';

const phoneNumber = '0949880111';
const networkType = myanmarPhoneNumber.getPhoneNetworkType(phoneNumber);

License πŸ“œ

This project operates under the MIT License.

Credit πŸ™Œ

Huge thanks to Kaung Myat Lwin for creating the original JavaScript library that inspired this one! πŸ‘

About

πŸ“ž Unlock the power of this TypeScript library! It's your go-to toolkit for validating and extracting insights from Myanmar phone numbers. πŸ‡²πŸ‡²πŸ”

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published