Comprehensive registry of countries and their associated currencies.

This module provides detailed information about countries worldwide, including their official currencies, codes, and geographical data. Follows ISO 3166-1 (country codes) and ISO 4217 (currency codes) standards.

Constructors

Methods

  • Gets country information by ISO2 code.

    Parameters

    • iso2: string

      The 2-letter country code (e.g., "US", "MX")

    Returns undefined | CountryInfo

    Country info or undefined if not found

    const country = CountryRegistry.getByISO2('MX');
    console.log(country?.name); // "Mexico"
    console.log(country?.currencyCode); // "MXN"
  • Gets country information by ISO3 code.

    Parameters

    • iso3: string

      The 3-letter country code (e.g., "USA", "MEX")

    Returns undefined | CountryInfo

    Country info or undefined if not found

    const country = CountryRegistry.getByISO3('MEX');
    console.log(country?.name); // "Mexico"
  • Gets all countries that use a specific currency.

    Parameters

    • currencyCode: string

      The ISO 4217 currency code (e.g., "USD", "EUR")

    Returns CountryInfo[]

    Array of countries using this currency

    const eurCountries = CountryRegistry.getByCurrency('EUR');
    console.log(eurCountries.length); // 19+ countries