npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

i18n-iso-countries-extended-info

v1.8.0

Published

Downloads

24

Readme

i18n-iso-countries-extended-info

Introduction

i18n-iso-countries-extended-info package provides some of the basic and important information about the countries in the world. The information provided is completely in a standardized format.

Features

  • Get ISO codes (both ISO-2 and ISO-3) for all the country around the world
  • Get information about the countries from their respective ISO and numeric codes
  • Information provided
    • ISO-2/ISO-3 Codes
    • Numeric Codes
    • Country Name
  • Validation of ISO-2/ISO-3 code for the countries

API Usage

The following is auto-generated from ./src/countryIsoInformationService.ts:

__export · value

Value: any

getAllCountriesAlphaCodes · function

This function retrieves all countries' ISO codes based on the specified alpha code type.

Signature: (alphaCodeType: "Alpha-2" | "Alpha-3") => CountryIsoCodePreview[]

Parameters:

  • alphaCodeType - - The type of alpha code ("Alpha-2" or "Alpha-3") to filter the countries by.

Returns: An array of country ISO code previews corresponding to the specified alpha code type.

Throws:

  • Will throw an error if the provided alpha code type is invalid.

Examples:

const alpha2Codes = getAllCountriesAlphaCodes("Alpha-2");
const alpha3Codes = getAllCountriesAlphaCodes("Alpha-3");

getCountryAlphaCodeByName · function

This function retrieves the ISO code(s) for a given country name based on the specified alpha code type.

Signature: (countryName: string, alphaCode?: "Alpha-2" | "Alpha-3" | "both") => string

Parameters:

  • countryName - - The name of the country to retrieve the ISO code(s) for.
  • alphaCode - - The type of alpha code to retrieve ("Alpha-2", "Alpha-3", or "both"). Default is "Alpha-2".

Returns: The ISO code(s) corresponding to the specified country name and alpha code type.

Throws:

  • Will throw an error if the country name is not found or if the alpha code type is invalid.

Examples:

const alpha2Code = getCountryAlphaCodeByName("United States", "Alpha-2");
const alpha3Code = getCountryAlphaCodeByName("United States", "Alpha-3");
const bothCodes = getCountryAlphaCodeByName("United States", "both");

getCountryCurrencyInformationByAlpha2Code · function

The following functions retrieve various types of country information based on Alpha-2 code identifiers.

Signature: (alpha2Code: string) => CurrencyInfo

Parameters:

  • alpha2Code - - The Alpha-2 code of the country.

Returns: Currency information of the country.

Throws:

  • Will throw an error if the Alpha-2 code is not found.

Examples:

const currencyInfo = getCountryCurrencyInformationByAlpha2Code("US");
result: {
   "currency": "USD",
   "symbol": "$",
   "currencyName": "United States dollar"
 }

getCountryDetailInformationByAlpha2Code · function

  • The following functions retrieve various types of country information based on Alpha-2 code identifiers.

Signature: (alpha2Code: string) => CountryDetailInformation

Parameters:

  • alpha2Code - - The Alpha-2 code of the country.

Returns: Detailed information of the country.

Throws:

  • Will throw an error if the Alpha-2 code is not found.

Examples:

const detailInfo = getCountryDetailInformationByAlpha2Code("US");
result:{
 "name": "United States",
 "native": "United States",
 "capital": "Washington D.C.",
 "flag": "🇺🇸",
 "isdCodes": [
     1
 ],
 "language": {
     "code": "en",
     "official": "English",
     "others": [
       "en"
     ]
 },
 "continent": "NA",
 "region": "North America",
 "currency": "USD",
 "symbol": "$",
 "currencyName": "United States dollar"
}

getCountryGeneralInformationByAlpha2Code · function

  • The following functions retrieve various types of country information based on Alpha-2 code identifiers.

Signature: (alpha2Code: string) => CountryInfo

Parameters:

  • alpha2Code - - The Alpha-2 code of the country.

Returns: General information of the country.

Throws:

  • Will throw an error if the Alpha-2 code is not found.

Examples:

const generalInfo = getCountryGeneralInformationByAlpha2Code("US");
result: {
   "name": "United States",
   "native": "United States",
   "capital": "Washington D.C.",
   "flag": "🇺🇸",
   "isdCodes": [
       1
   ],
   "language": {
       "code": "en",
       "official": "English",
       "others": [
         "en"
       ]
   }
 }

getCountryLocationInformationByAlpha2Code · function

  • The following functions retrieve various types of country information based on Alpha-2 code identifiers.

Signature: (alpha2Code: string) => LocationInfo

Parameters:

  • alpha2Code - - The Alpha-2 code of the country.

Returns: Location information of the country.

Throws:

  • Will throw an error if the Alpha-2 code is not found.

Examples:

const locationInfo = getCountryLocationInformationByAlpha2Code("US");
result: {
 "continent": "NA",
 "region": "North America"
}

getCountryCurrencyInformationByAlpha3Code · function

  • The following functions retrieve various types of country information based on Alpha-3 code identifiers.

Signature: (alpha3Code: string) => CurrencyInfo

Parameters:

  • alpha3Code - - The Alpha-3 code of the country.

Returns: Currency information of the country.

Throws:

  • Will throw an error if the Alpha-3 code is not found.

Examples:

const currencyInfo = getCountryCurrencyInformationByAlpha3Code("USA");
result: {
   "currency": "USD",
   "symbol": "$",
   "currencyName": "United States dollar"
 }

getCountryDetailInformationByAlpha3Code · function

  • The following functions retrieve various types of country information based on Alpha-3 code identifiers.

Signature: (alpha3Code: string) => CountryDetailInformation

Parameters:

  • alpha3Code - - The Alpha-3 code of the country.

Returns: Detailed information of the country.

Throws:

  • Will throw an error if the Alpha-3 code is not found.

Examples:

const detailInfo = getCountryDetailInformationByAlpha3Code("USA");
result:{
 "name": "United States",
 "native": "United States",
 "capital": "Washington D.C.",
 "flag": "🇺🇸",
 "isdCodes": [
     1
 ],
 "language": {
     "code": "en",
     "official": "English",
     "others": [
       "en"
     ]
 },
 "continent": "NA",
 "region": "North America",
 "currency": "USD",
 "symbol": "$",
 "currencyName": "United States dollar"
}

getCountryGeneralInformationByAlpha3Code · function

  • The following functions retrieve various types of country information based on Alpha-3 code identifiers.

Signature: (alpha3Code: string) => CountryInfo

Parameters:

  • alpha3Code - - The Alpha-3 code of the country.

Returns: General information of the country.

Throws:

  • Will throw an error if the Alpha-3 code is not found.

Examples:

const generalInfo = getCountryGeneralInformationByAlpha3Code("USA");
result: {
   "name": "United States",
   "native": "United States",
   "capital": "Washington D.C.",
   "flag": "🇺🇸",
   "isdCodes": [
       1
   ],
   "language": {
       "code": "en",
       "official": "English",
       "others": [
         "en"
       ]
   }
 }

getCountryLocationInformationByAlpha3Code · function

  • The following functions retrieve various types of country information based on Alpha-3 code identifiers.

Signature: (alpha3Code: string) => LocationInfo

Parameters:

  • alpha3Code - - The Alpha-3 code of the country.

Returns: Location information of the country.

Throws:

  • Will throw an error if the Alpha-3 code is not found.

Examples:

const locationInfo = getCountryLocationInformationByAlpha3Code("USA");
result: {
 "continent": "NA",
 "region": "North America"
}

getCountryCurrencyInformationByName · function

  • The following functions retrieve various types of country information based on country names.

Signature: (name: string) => CurrencyInfo

Parameters:

  • name - - The name of the country.

Returns: Currency information of the country.

Throws:

  • Will throw an error if the country name is not found.

Examples:

const currencyInfo = getCountryCurrencyInformationByName("United States");
result: {
   "currency": "USD",
   "symbol": "$",
   "currencyName": "United States dollar"
 }

getCountryDetailInformationByName · function

  • The following functions retrieve various types of country information based on country names.

Signature: (name: string) => CountryDetailInformation

Parameters:

  • name - - The name of the country.

Returns: Detailed information of the country.

Throws:

  • Will throw an error if the country name is not found.

Examples:

const detailInfo = getCountryDetailInformationByName("United States");
result:{
 "name": "United States",
 "native": "United States",
 "capital": "Washington D.C.",
 "flag": "🇺🇸",
 "isdCodes": [
     1
 ],
 "language": {
     "code": "en",
     "official": "English",
     "others": [
       "en"
     ]
 },
 "continent": "NA",
 "region": "North America",
 "currency": "USD",
 "symbol": "$",
 "currencyName": "United States dollar"
}

getCountryGeneralInformationByName · function

  • The following functions retrieve various types of country information based on country names.

Signature: (name: string) => CountryInfo

Parameters:

  • name - - The name of the country.

Returns: General information of the country.

Throws:

  • Will throw an error if the country name is not found.

Examples:

const generalInfo = getCountryGeneralInformationByName("United States");
result: {
   "name": "United States",
   "native": "United States",
   "capital": "Washington D.C.",
   "flag": "🇺🇸",
   "isdCodes": [
       1
   ],
   "language": {
       "code": "en",
       "official": "English",
       "others": [
         "en"
       ]
   }
 }

getCountryLocationInformationByName · function

  • The following functions retrieve various types of country information based on country names.

Signature: (name: string) => LocationInfo

Parameters:

  • name - - The name of the country.

Returns: Location information of the country.

Throws:

  • Will throw an error if the country name is not found.

Examples:

const locationInfo = getCountryLocationInformationByName("United States");
result: {
 "continent": "NA",
 "region": "North America"
}

getCountryCurrencyInformationByNumericCode · function

  • The following functions retrieve various types of country information based on Numeric code identifiers.

Signature: (numericCode: string) => CurrencyInfo

Parameters:

  • numericCode - - The Numeric code of the country.

Returns: Currency information of the country.

Throws:

  • Will throw an error if the Numeric code is not found.

Examples:

const currencyInfo = getCountryCurrencyInformationByNumericCode("840");
result: {
   "currency": "USD",
   "symbol": "$",
   "currencyName": "United States dollar"
 }

getCountryDetailInformationByNumericCode · function

  • The following functions retrieve various types of country information based on Numeric code identifiers.

Signature: (numericCode: string) => CountryDetailInformation

Parameters:

  • numericCode - - The Numeric code of the country.

Returns: Detailed information of the country.

Throws:

  • Will throw an error if the Numeric code is not found.

Examples:

const detailInfo = getCountryDetailInformationByNumericCode("840");
result:{
 "name": "United States",
 "native": "United States",
 "capital": "Washington D.C.",
 "flag": "🇺🇸",
 "isdCodes": [
     1
 ],
 "language": {
     "code": "en",
     "official": "English",
     "others": [
       "en"
     ]
 },
 "continent": "NA",
 "region": "North America",
 "currency": "USD",
 "symbol": "$",
 "currencyName": "United States dollar"
}

getCountryGeneralInformationByNumericCode · function

  • The following functions retrieve various types of country information based on Numeric code identifiers.

Signature: (numericCode: string) => CountryInfo

Parameters:

  • numericCode - - The Numeric code of the country.

Returns: General information of the country.

Throws:

  • Will throw an error if the Numeric code is not found.

Examples:

const generalInfo = getCountryGeneralInformationByNumericCode("840");
result: {
   "name": "United States",
   "native": "United States",
   "capital": "Washington D.C.",
   "flag": "🇺🇸",
   "isdCodes": [
       1
   ],
   "language": {
       "code": "en",
       "official": "English",
       "others": [
         "en"
       ]
   }
 }

getCountryLocationInformationByNumericCode · function

  • The following functions retrieve various types of country information based on Numeric code identifiers.

Signature: (numericCode: string) => LocationInfo

Parameters:

  • numericCode - - The Numeric code of the country.

Returns: Location information of the country.

Throws:

  • Will throw an error if the Numeric code is not found.

Examples:

const locationInfo = getCountryLocationInformationByNumericCode("840");
result: {
 "continent": "NA",
 "region": "North America"
}

License

MIT License