1.0.2 • Published 2 months ago

itu-e164-country-codes v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

ITU-T E.164 Country Code Lookup

npm version License: MIT CircleCI Coverage Status Known Vulnerabilities

Javascript Module for searching ITU E.164 Country Codes.

Source data:

Installation

npm install itu-e164-country-codes

Usage

fromITUCode

Search for records by ITU E.164 assigned country code.

```javascript
const { fromITUCode } = require('itu-e164-country-codes');

// Search by ITU E.164 Country Code
console.log(fromITUCode(372));
/*
[
  {
    itu_country_code: 372,
    name: 'Estonia (Republic of)',
    iso_country_code: 'EW'
  }
]
 */

NOTE: Many ITU E.164 assigned country codes represent multiple countries or regions. Each region recognised by the ITU is represented as a separate record.

fromISOCode

Search for records by ISO 3166-1 alpha-2 Country Code.

// Search by ISO 3166-1 alpha-2 Country Code
console.log(fromISOCode('AU'));
/*
[
  {
    itu_country_code: 61,
    name: 'Australia',
    iso_country_code: 'AU'
  },
  {
    itu_country_code: 672,
    name: 'Australian External Territories',
    iso_country_code: 'AU'
  }
]
 */

NOTE: Some ITU E.164 assigned country codes correspond to sub-regions of an ISO 3166-1 recognised country which is not separately recognised by the ISO. In these cases these are grouped under the primary ISO-3166-1 code. This means multiple entries may match a single ISO 3166-1 alpha-2 country code.

Data Structure

[
  {
    itu_country_code: number,
    name: string,
    iso_country_code: string
  }
]
FieldTypeDescriptionNotes
itu_country_codenumberITU-T E.164 assigned country code
iso_country_codestring | nullISO 3166-1 alpha-2 country codeWhere the ITU code represents a sub-region of a country which does not have a seperate ISO 3166-1 designation the country designation is used. If the ITU code does not correspond to a country or region of a country this will be null.
namestring | nullNameDefined as per the ITU document "List of Recommendation ITU-T E.164 assigned country codes". If the ITU-T documentation lists this ITU-T e.164 assigned country code as "Spare" this will be null.
1.0.2

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago