Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lwinmoehein/mm-mobile-tools-js
A javascript library for working with Myanmar phone numbers
https://github.com/lwinmoehein/mm-mobile-tools-js
myanmar myanmar-phone-number myanmar-tools phone-number phone-number-validator typescript
Last synced: 11 days ago
JSON representation
A javascript library for working with Myanmar phone numbers
- Host: GitHub
- URL: https://github.com/lwinmoehein/mm-mobile-tools-js
- Owner: lwinmoehein
- License: mit
- Created: 2023-11-01T15:35:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-23T07:46:23.000Z (about 1 year ago)
- Last Synced: 2024-10-22T22:15:20.306Z (3 months ago)
- Topics: myanmar, myanmar-phone-number, myanmar-tools, phone-number, phone-number-validator, typescript
- Language: TypeScript
- Homepage:
- Size: 83 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
MM Mobile Tools - JavascriptA npm package for working with Myanmar phone numbers
[![npm version](https://img.shields.io/npm/v/mm-mobile-tool.svg?style=flat-square)](https://www.npmjs.org/package/mm-mobile-tool)
![Build status](https://github.com/lwinmoehein/MM-Mobiile-Tools-JS/actions/workflows/ci.yml/badge.svg)
[![codecov](https://codecov.io/gh/lwinmoehein/MM-Mobile-Tools-JS/graph/badge.svg?token=YVS9A98YJQ)](https://codecov.io/gh/lwinmoehein/MM-Mobile-Tools-JS)
[![npm downloads](https://img.shields.io/npm/dm/mm-mobile-tool.svg?style=flat-square)](https://npm-stat.com/charts.html?package=mm-mobile-tool)> currently only supports ES modules
## Table of Contents
- [Features](#features)
- [Installing](#installing)
- [Package manager](#package-manager)
- [Examples](#examples)
- [License](#license)
## Features- Check if a phone number is a valid Myanmar phone number
- Get the operator from a phone number## Installing
### Package manager
Using npm:
```bash
$ npm install mm-mobile-tool
```Once the package is installed, you can import the library using `import`:
```js
import mmphone from 'mm-mobile-tool';
```## Examples
### Check if phone number is valid
```js
import mmphone from 'mm-mobile-tool';if(mmphone.isValid("09440813577")){
console.log("Phone number is valid");
}
```
### Get operator```js
import mmphone,{ Operator } from 'mm-mobile-tool';if(mmphone.getOperator("09440813577")===Operator.MPT){
console.log("Phone number is MPT");
}
```### Operator types
- MPT = Operator.MPT
- Ooredoo = Operator.OOREDOO
- ATOM = Operator.ATOM
- MECTel = Operator.MECTEL
- MyTel = Operator.MYTEL## License
[MIT](LICENSE)