Skip to content

Dictionary of network operators based on mcc-mnc values

Notifications You must be signed in to change notification settings

hlycharles/mcc-mnc-list-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mcc-mnc-list-js

Dictionary from mcc-mnc codes to network operators based on the following Wikipedia info: https://en.wikipedia.org/wiki/Mobile_country_code

Installation

npm install mcc-mnc-list-js

Record Structure

CELL_OPERATORS = {
  `${mcc}${mnc}`: [
    {
      bands: String
      mcc: String
      operator: String
      mnc: String
    },
    ...
  ],
  ...
}

Example Usage

The (mcc=311, mnc=488) pair currently belongs to Verizon Wireless.

The following code retrieves operator information on (mcc=311, mnc=488).

import {CELL_OPERATORS} from 'mcc-mnc-list-js';

const mcc = '311';
const mnc = '488';
const key = `${mcc}${mnc}`;
if (key in CELL_OPERATORS) {
  const operators = CELL_OPERATORS[key];
  console.log(`# of operators: ${operators.length}`);
  console.log(`bands: ${operators[0].bands}`);
  console.log(`mcc: ${operators[0].mcc}`);
  console.log(`mnc: ${operators[0].mnc}`);
  console.log(`operator: ${operators[0].operator}`);
}

The console output is

# of operators: 1
bands: LTE 700
mcc: 311
mnc: 488
operator: Verizon Wireless

About

Dictionary of network operators based on mcc-mnc values

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published