Reference · Countries and lookup tools
countriesfunction
Every country: the 249 ISO 3166-1 codes and Kosovo (XK). order: "en" sorts by the English name folded
(accents and case set aside); order: "ja" by the Japanese name in kana, its reading where it is written in
kanji, in plain kana order (not a full Japanese collation).
Import it
import { countries } from "@johnmorrisdotca/kuni";
Definition
function countries(options?: CountriesOptions): readonly Country[]
Parameters
| Name | Type | Description |
|---|---|---|
options (optional) | CountriesOptions |
|
Returns
readonly Country[]
The 250 countries, the list and its objects frozen and shared.
Examples
import { countries } from "@johnmorrisdotca/kuni";
console.log(countries().length); // 250
console.log(countries({ order: "en" })[0].name.en); // "Afghanistan"
console.log(countries({ order: "ja" })[0].name.ja); // "アイスランド"250
Afghanistan
アイスランドWhat it prints (run when this page was built)