ts-phonenumber - v2.0.0
    Preparing search index...

    Function getCountryCodeForRegion

    • Gets the country calling code for a region.

      Parameters

      • regionCode: string

        ISO 3166-1 alpha-2 region code (e.g., "DE", "US")

      Returns Promise<number | undefined>

      The country calling code (e.g., 49, 1) or undefined if unknown

      await getCountryCodeForRegion("DE")  // 49
      await getCountryCodeForRegion("US") // 1
      await getCountryCodeForRegion("GB") // 44