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 · Countries and lookup tools

flagfunction

The flag of a country as an emoji: two regional-indicator letters, which most systems draw as the flag and some (Windows) as the two letters. Write the country's name beside it.

Import it

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

Definition

function flag(code: string): string | null

Parameters

NameTypeDescription
codestring

Any code country() takes.

Returns

string | null

The emoji; null for a code that is not a country.

Examples

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

console.log(flag("JP"));   // "🇯🇵"
console.log(flag("XX"));   // null
🇯🇵
null

What it prints (run when this page was built)

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