包详细信息

alpha2-countries

slatkovic1.1kSEE LICENSE IN LICENSE1.1.0

ISO 3166-1 alpha-2 country names and codes

ISO, 3166-1, alpha-2, countries

自述文件

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.