0.3.0 • Published 2 years ago

@tertium/countries v0.3.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Countries

Important! Only EN and RU - please add other languages into GitHub repo!

Get all countries

const countries = getCountries();

Result:

[
  {
    name: 'Afghanistan',
    numeric: '004',
    alpha2: 'AF',
    alpha3: 'AFG',
    dial: '93',
    image: './images/AF.svg',
  }
]

Get country by name

const country = getCountryByName('Afghanistan');

Result:

{
  name: 'Afghanistan',
  numeric: '004',
  alpha2: 'AF',
  alpha3: 'AFG',
  dial: '93',
  image: './images/AF.svg',
}

Get country by localized name

const country = getCountryByName('Россия', 'ru');

Result:

{
  name: 'Россия',
  numeric: '643',
  alpha2: 'RU',
  alpha3: 'RUS',
  dial: '7',
  image: './images/RU.svg',
}