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 facts

allFactsfunction

The facts about every country, in alpha-2 order: one object for each of the 250 codes, the list and its objects frozen and shared. Plain numbers and codes, so a build script can write them out as JSON as they are.

Import it

import { allFacts } from "@johnmorrisdotca/kuni/facts";

Definition

function allFacts(): readonly CountryFacts[]

Returns

readonly CountryFacts[]

Every country's facts.

Examples

import { allFacts } from "@johnmorrisdotca/kuni/facts";

const crowded = allFacts()
  .filter((one) => one.population !== null && one.areaKm2 !== null)
  .sort((a, b) => b.population! / b.areaKm2! - a.population! / a.areaKm2!)[0].alpha2; // "MC"

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