本文へ移動

Kuni国

国、コード、名前、行政区画を調べ、必要なときに国のデータを読み込み、標準の国のカードを表示できます。

「国(くに)」は、国を表す日本語です。 名前について(英語)

目次

リファレンス · 国の情報

allFacts関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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 { allFacts } from "@johnmorrisdotca/kuni/facts";

定義

function allFacts(): readonly CountryFacts[]

戻り値

readonly CountryFacts[]

Every country's facts.

例

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"

ソースを見るGitHub で編集@johnmorrisdotca/kuni 1.4.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。