Reference · Countries and lookup tools
Countrytype
A country, or a territory with an ISO 3166-1 code of its own, as the lookups hand it out (frozen).
Import it
import type { Country } from "@johnmorrisdotca/kuni";
Definition
interface Country {
alpha2: string;
alpha3: string;
numeric: string;
kind: "iso" | "user";
name: {
en: string;
ja: string;
local?: string;
};
shortName?: {
en?: string;
ja?: string;
};
reading?: string;
flag: string;
continent: Continent;
subregion?: string;
callingCode?: string;
currency?: string[];
tld?: string;
capital?: {
en: string;
ja: string;
};
zones?: string[];
languages?: string[];
subdivisionType?: SubdivisionType;
aliases?: string[];
ioc?: string;
}
Members
| Name | Type | Description |
|---|---|---|
alpha2 | string | ISO 3166-1 alpha-2, "JP" |
alpha3 | string | ISO 3166-1 alpha-3, "JPN" |
numeric | string | ISO 3166-1 numeric, three digits, "392" |
kind | "iso" | "user" | "user" for a user-assigned code in common use: Kosovo, XK |
name | { en: string; ja: string; local?: string; } | CLDR's names; local is the country's own name, where it differs |
shortName (optional) | { en?: string; ja?: string; } | undefined | CLDR's short form: "US" and アメリカ for the United States |
reading (optional) | string | undefined | The Japanese name in hiragana, only where the name is written in kanji |
flag | string | The flag emoji: the two regional-indicator letters of alpha2 |
continent | "AF" | "AS" | "NA" | "SA" | "AN" | "EU" | "OC" | The continent it is in, in the seven-continent model: "AS". |
subregion (optional) | string | undefined | The UN M49 subregion, three digits: "030" is Eastern Asia |
callingCode (optional) | string | undefined | The ITU country calling code, "+81"; "+1" for every member of the North American plan |
currency (optional) | string[] | undefined | ISO 4217 codes of the currencies in use now, from CLDR: ["JPY"] |
tld (optional) | string | undefined | The country-code top-level domain without its dot: "jp", and "uk" for GB |
capital (optional) | { en: string; ja: string; } | undefined | The capital's name: English from countries-list, Japanese from Wikidata |
zones (optional) | string[] | undefined | IANA time zones, from zone.tab, in its order: ["Asia/Tokyo"] |
languages (optional) | string[] | undefined | ISO 639-1 codes of the languages spoken, most used first |
subdivisionType (optional) | "atoll" | "autonomous-community" | "autonomous-region" | "borough" | "canton" | "capital-district" | "circuit" | "city" | "council-area" | "country" | "county" | "department" | "district" | "division" | "emirate" | "governorate" | "island" | "krai" | "metropolis" | "municipality" | "oblast" | "parish" | "prefecture" | "principal-area" | "province" | "quarter" | "region" | "republic" | "special-administrative-region" | "state" | "territory" | "unitary-authority" | "urban-prefecture" | "voivodeship" | "zone" | undefined | The kind most of its first-level subdivisions are |
aliases (optional) | string[] | undefined | Other names people use for it, in either language: "Holland", "UK", 米国 |
ioc (optional) | string | undefined | The International Olympic Committee's country code, three letters and not always the alpha-3: "JPN", "GER" for Germany (DEU), "SUI" for Switzerland (CHE). From Wikidata (P984). Absent for the countries with no National Olympic Committee. |
Examples
import type { Country } from "@johnmorrisdotca/kuni";
import { country } from "@johnmorrisdotca/kuni";
const value: Country = country("JP")!;
console.log(typeof value === "object" ? Object.keys(value).slice(0,6) : value);[ 'alpha2', 'alpha3', 'numeric', 'kind', 'name', 'flag' ]What it prints (run when this page was built)