One of the 34 supported CountryCode values.
Any BCP 47 language tag (default "en"). Unsupported
locales fall back to whatever the runtime's Intl.DisplayNames picks.
A CountryInfo object. Always defined for valid CountryCode inputs since the alpha-3 table covers them all.
import { getCountryInfo } from "nationid/catalog";
getCountryInfo("MX", "es");
// { code: "MX", alpha3: "MEX", name: "México", flag: "🇲🇽" }
getCountryInfo("BR", "pt");
// { code: "BR", alpha3: "BRA", name: "Brasil", flag: "🇧🇷" }
getCountryInfo("GB"); // default locale "en"
// { code: "GB", alpha3: "GBR", name: "United Kingdom", flag: "🇬🇧" }
Returns the localized CountryInfo for
code.Resolves the country name via Intl.DisplayNames (CLDR data shipped with the runtime) and computes the flag emoji from the ISO code. The
alpha3field comes from a hand-maintained ISO 3166-1 alpha-3 table.