New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

country-code-flag-emojis

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

country-code-flag-emojis

Convert country codes to flag emojis

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
4
100%
Maintainers
0
Weekly downloads
 
Created
Source

CountryFlagEmoji Package

A JavaScript package to convert country codes to flag emojis and validate them.

Overview

This package provides a class, CountryFlagEmoji, that allows you to convert country codes into their corresponding flag emojis. It also includes a function, convertToFlag, to easily instantiate the CountryFlagEmoji class.

Features

  • Convert a country code to its flag emoji.
  • Validate if a given country code corresponds to a valid flag emoji.

Installation

To install this package, use npm:

npm install country-code-flag-emojis

Usage

import convertToFlag from "./path-to-your-package";

// Convert country code to flag emoji
const flagEmoji = convertToFlag("US");
console.log(flagEmoji.getFlag()); // Output: 🇺🇸

// Check if the country code is valid
console.log(flagEmoji.checkCodeValid()); // Output: This is a valid country code

Keywords

country

FAQs

Package last updated on 27 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts