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 · Regions and international bodies

groupingsfunction

Every grouping, or those of one kind or inside one country, in a fixed order: continents, UN M49 areas, international bodies, informal groupings, then regions inside a country.

Import it

import { groupings } from "@johnmorrisdotca/kuni/groupings";

Definition

function groupings(options?: GroupingsOptions): readonly Grouping[]

Parameters

NameTypeDescription
options (optional)GroupingsOptions

kind to keep one kind, country to keep the groupings of one country's subdivisions.

Returns

readonly Grouping[]

The groupings, frozen; an empty list where none match.

Examples

import { groupings } from "@johnmorrisdotca/kuni/groupings";

console.log(groupings({ kind: "continent" }).map((one) => one.name.en)); // ["Africa", "Antarctica", "Asia", "Europe", ...]
console.log(groupings({ country: "JP" }).length);                         // 10: the eight 地方, and the nine-region variant's two
[
  'Africa',
  'Antarctica',
  'Asia',
  'Europe',
  'North America',
  'Oceania',
  'South America'
]
10

What it prints (run when this page was built)

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