alpha2-countries

ISO 3166-1 alpha-2 country names and codes


Keywords
ISO, 3166-1, alpha-2, countries, country
License
ICU
Install
npm install alpha2-countries@1.1.0

Documentation

alpha2-countries

Exposes ISO 3166-1 alpha-2 country names and codes and simple name/code resolution abilities.

Uses data from https://datahub.io/core/country-list.

Usage

const countries = require('alpha2-countries')
// Input: 'US'
// Output: 'United States'
countries.resolveName('US')
// Input: 'United States'
// Output: 'US'
countries.resolveCode('United States')
// Output: [..., { code: 'US', name: 'United States' }, ...]
countries.getNameCodePairs()

Dependencies

Has no external dependencies.