1.1.0 • Published 6 years ago
mcc-mnc v1.1.0
mcc-mnc
A wrapper for mcc-mnc lookup.
JSON source file
The source file is taken from musalbas's mcc-mnc-table repo.
Installation
Install the package using npm install mcc-mnc.
Usage
After installation, include it and instantiate it to use it:
var MccMnc = require('mcc-mnc');
var mccMnc = new MccMnc();Available methods are:
mcc(int)Filter bymccmnc(int)Filter bymnccountry(string)Filter bycountrynetwork(string)Filter bynetworkcountryCode(string)Filter bycountry_codeget()Returns all the matched filtersclear()Clears the search filter.
Examples
Example 1:
const MccMnc = require('mcc-mnc');
const mccMnc = new MccMnc();
const match = mccMnc.mcc(310).mnc(330).get();
console.log(match);Returns:
{
network: 'T-Mobile',
country: 'United States',
mcc: '310',
iso: 'us',
country_code: '1',
mnc: '330'
}Example 2:
const MccMnc = require('mcc-mnc');
const mccMnc = new MccMnc();
const match = mccMnc.mnc(330).get();
console.log(match);Returns:
[
{ network: 'Claro/ CTI/AMX',
country: 'Argentina Republic',
mcc: '722',
iso: 'ar',
country_code: '54',
mnc: '330' },
{ network: 'Michigan Wireless LLC',
country: 'United States',
mcc: '311',
iso: 'us',
country_code: '1',
mnc: '330' },
{ network: 'T-Mobile',
country: 'United States',
mcc: '310',
iso: 'us',
country_code: '1',
mnc: '330' }
]If no match is found, -1 is returned.