Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seanghay/network-operators
📞 A package for querying network operators in Cambodia.
https://github.com/seanghay/network-operators
cambodia cellcard khmer metfone network smart telecommunications
Last synced: about 2 months ago
JSON representation
📞 A package for querying network operators in Cambodia.
- Host: GitHub
- URL: https://github.com/seanghay/network-operators
- Owner: seanghay
- License: other
- Created: 2022-07-07T03:28:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-07T07:16:29.000Z (over 2 years ago)
- Last Synced: 2023-12-09T11:40:32.673Z (about 1 year ago)
- Topics: cambodia, cellcard, khmer, metfone, network, smart, telecommunications
- Language: TypeScript
- Homepage: https://network.deno.dev
- Size: 32.2 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# 📞 Network Operators
A package for querying network operators in Cambodia.
[![test](https://github.com/seanghay/network-operators/actions/workflows/test.yml/badge.svg)](https://github.com/seanghay/network-operators/actions/workflows/test.yml)
[![npm](https://img.shields.io/npm/v/network-operators)](https://npmjs.com/package/network-operators)## Install
npm
```
npm install network-operators
```pnpm
```
pnpm add network-operators
```yarn
```
yarn add network-operators
```## Usage
```js
// ESM
import {
prefixInfo,
phoneNumberInfo,
networkOperators,
parsePhoneNumber
} from 'network-operators'// CJS
const {
prefixInfo,
phoneNumberInfo,
networkOperators,
parsePhoneNumber
} = require('network-operators')console.log(prefixInfo('012'))
// { operator: 'Cellcard', length: [ 6, 7 ] }console.log(phoneNumberInfo('012123123'))
// {
// operator: 'Cellcard',
// length: [ 6, 7 ],
// prefix: '012',
// suffix: '123123',
// number: '012123123'
// }console.log(networkOperators())
// [
// 'Cellcard', 'CooTel',
// 'Kingtel', 'Seatel',
// 'Metfone', 'qb',
// 'Smart'
// ]console.log(parsePhoneNumber('010123123'))
// { prefix: '010', suffix: '123123', number: '010123123' }
```## Free Public API runs on deno.dev
```
https://network.deno.dev/010
https://network.deno.dev/096
https://network.deno.dev/086
https://network.deno.dev/012888999
```## License
Apache-2.0
## References
[Telephone numbers in Cambodia](https://en.wikipedia.org/wiki/Telephone_numbers_in_Cambodia)