alpha2-countries
v1.1.0
Published
ISO 3166-1 alpha-2 country names and codes
Downloads
736
Maintainers
Readme
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.