mcc-mnc
v1.1.0
Published
A wrapper for mcc-mnc lookup
Downloads
19
Maintainers
Readme
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 bymcc
mnc(int)
Filter bymnc
country(string)
Filter bycountry
network(string)
Filter bynetwork
countryCode(string)
Filter bycountry_code
get()
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.