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 · Country trivia

CountryTriviatype

The trivia about one country, from the /trivia entry: null where the source has none.

Import it

import type { CountryTrivia } from "@johnmorrisdotca/kuni/trivia";

Definition

interface CountryTrivia {
    alpha2: string;
    inception: {
        year: number;
        day?: string;
    } | null;
    officialLanguages: readonly string[];
    largestCity: {
        id: string;
        name: {
            en: string;
            ja: string | null;
        };
    } | null;
}

Members

NameTypeDescription
alpha2string

ISO 3166-1 alpha-2, "JP"

inception{ year: number; day?: string; } | null

When Wikidata says the country, as it is today, began (P571, inception): the year, and the day where Wikidata gives one. Often the day of independence (India, 1947-08-15), sometimes a constitution or a union (Japan, 1947-05-03), so it is not a date of independence. null where Wikidata has none, or several.

officialLanguagesreadonly string[]

The languages CLDR records as official there, by law or in fact, most spoken first: language subtags, ISO 639-1 where the language has one ("en") and ISO 639-3 otherwise ("gsw"). Empty where CLDR records none. The languages people speak, official or not, are country(code).languages.

largestCity{ id: string; name: { en: string; ja: string | null; }; } | null

The city with the most people in the city itself (its city proper: the municipality or district that is the city, as its census counts it), not the urban area round it: Rome for Italy, not Milan. Its id in /cities and its name. null for a country with no city of 15,000 people in kuni, or whose largest place kuni does not have under its code (Guam's Dededo). docs/trivia.md lists the figures set by hand and every gap.

Examples

import type { CountryTrivia } from "@johnmorrisdotca/kuni/trivia";
import { trivia } from "@johnmorrisdotca/kuni/trivia";

const value: CountryTrivia = trivia("JP")!;
console.log(typeof value === "object" ? Object.keys(value).slice(0,6) : value);
[ 'alpha2', 'inception', 'officialLanguages', 'largestCity' ]

What it prints (run when this page was built)

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