nationid - v2.2.1
    Preparing search index...

    Function flagEmoji

    • Returns the flag emoji for a country code.

      Pure function — no data table, no I/O. Works for any ISO 3166-1 alpha-2 code, not just the 34 supported here, so callers can pass e.g. "JP" and still get "🇯🇵" even though JP is not in CountryCode yet.

      Parameters

      • code: string

        ISO 3166-1 alpha-2 code (2 uppercase ASCII letters).

      Returns string

      The flag emoji as a string (composed of two regional indicator symbols, 8 bytes UTF-8 / 4 chars UTF-16).

      import { flagEmoji } from "nationid/catalog";

      flagEmoji("MX"); // "🇲🇽"
      flagEmoji("BR"); // "🇧🇷"
      flagEmoji("GB"); // "🇬🇧"