Maps ISO 3166-1-alpha-2 codes to English country names and vice versa.
npm install countries-data-list 
Maps ISO 3166-1-alpha-2 codes to English country names and vice versa.
Uses data from https://www.iso.org/iso-3166-country-codes.html
`` js
const { getCode, getName } = require('country-list');
console.log(getName('IS')); // Iceland
console.log(getCode('Iceland')); // IS
console.log(getCode('Nowhere-to-be-found-land')); // undefined
`
And how to change the name of a country
` js
const { overwrite, getName } = require('country-list');
overwrite([{
code: 'TW',
name: 'Taiwan'
}])
console.log(getName('TW')); // Taiwan
`
Usage:
` js`
const countryList = require('country-list');
All input is case-insensitive.
Expects an array of country objects containing code and name properties.` js`
[{
code: 'TW',
name: 'Taiwan'
}]
Expects a two-digit country code.
Returns the name for that country.
If not found, it returns undefined.
Expects the English country name.
Returns the code for that country.
If not found, it returns undefined.
Returns an array of all country names.
Returns an array of all country codes.
Returns a key-value object of all countries using the name as key.
Returns a key-value object of all countries using the code as key.
Returns an array of all country information, in the same format as it gets imported.
` cli``
npm install country-data-list
MIT