Any BCP 47 language tag (default "en").
Read-only array of CountryInfo, one per supported country.
import { listCountries } from "nationid/catalog";
listCountries("es");
// [
// { code: "SV", alpha3: "SLV", name: "El Salvador", flag: "🇸🇻" },
// { code: "MX", alpha3: "MEX", name: "México", flag: "🇲🇽" },
// …
// ]
// Alphabetical:
listCountries("es").toSorted((a, b) => a.name.localeCompare(b.name, "es"));
Lists every supported country with localized names and flag emojis.
Ordering is stable across patch releases — countries are returned in the order they were added to the library (matches v0.1 → v0.4 → v0.6 waves), not alphabetically. UIs that want alphabetical sorting can sort the result by
namein their locale.