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"