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

All subdivisions

import { … } from "@johnmorrisdotca/kuni/subdivisions";

88.4 kB minified and gzipped, with everything it imports (measured with esbuild)

Exports

NameKindWhat it is
allSubdivisionsfunctionEvery subdivision of every country, every level, in code order.
LeveltypeA level of subdivision: 1 for a country's first division, 2 and 3 for those inside one, or "all".
subdivisionfunctionOne subdivision by its ISO 3166-2 code.
SubdivisiontypeA subdivision of a country (a state, a province, a prefecture), with its ISO 3166-2 code, as the lookups hand it out (frozen).
SUBDIVISION_TYPESconstantThe kinds of subdivision, in kebab case.
subdivisionByNamefunctionThe one subdivision a typed name means.
SubdivisionByNameOptionstypeWhat subdivisionByName() and subdivisionsByName() may be narrowed to.
subdivisionByShortCodefunctionOne subdivision by its country and the part of its code after the hyphen.
subdivisionsfunctionA country's subdivisions, in code order: the first level unless level asks for another or for "all".
subdivisionsByNamefunctionEvery subdivision a typed name could be, in code order: its English or Japanese name, its Japanese name without the word for its kind (オンタリオ, 東京), a prefecture's reading, or its full code.
SubdivisionsOptionstypeWhat subdivisions() may be asked.
SubdivisionTypetypeA kind of subdivision, in kebab case: "prefecture", "state", "autonomous-community".
subdivisionTypeLabelfunctionThe word for a kind of subdivision.

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