Skip to the content

Kuni国

Look up countries, codes, names and subdivisions, load country data on demand and mount a native country card.

Kuni (国) is Japanese for a country. About the name

Contents

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

NameTypeDescription
options (optional)CountriesOptions

order: "code" (the default), "en" or "ja".

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)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kuni 1.4.0.