Skip to the content

Hata旗

Load a native country or region flag, choose supported framing and keep each drawing’s source, author and licence.

Hata (旗) is Japanese for a flag. About the name

Contents

Reference · Flags of international organisations

loadOrganisationFlagfunction

Any organisation's flag as an SVG string, loaded when it is asked for: each drawing is a module of its own (@johnmorrisdotca/hata/organisations/<slug>), so a page carries the drawings it asks for and no others. The same string organisationFlag gives for the European Union, and the drawing of each body taken from Wikimedia Commons.

Import it

import { loadOrganisationFlag } from "@johnmorrisdotca/hata/organisations";

Definition

function loadOrganisationFlag(id: string): Promise<string | null>

Parameters

NameTypeDescription
idstring

An organisation's id, in any case, with or without org: ("org:caricom", "CARICOM").

Returns

Promise<string | null>

The SVG string, or null when the id has no flag here.

Examples

import { loadOrganisationFlag } from "@johnmorrisdotca/hata/organisations";

console.log((await loadOrganisationFlag("org:caricom"))?.startsWith("<svg")); // true
console.log(await loadOrganisationFlag("org:xx"));                            // null
true
null

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hata 1.31.0.