@tertium/countries

0.3.0 • Public • Published

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',
}

Readme

Keywords

Package Sidebar

Install

npm i @tertium/countries

Weekly Downloads

5

Version

0.3.0

License

ISC

Unpacked Size

987 kB

Total Files

522

Last publish

Collaborators

  • tertiumnon