JSPM

emoji-country-code

1.0.2-2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q42131F
  • License MIT

Transform ISO 3166-1 country codes to Emoji flags

Package Exports

  • emoji-country-code

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (emoji-country-code) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

emoji-country-code

Transform ISO 3166-1 country codes to Emoji flags

Installation

Installation is the same as any other npm module.

yarn add emoji-country-code

or

npm install --save emoji-country-code

Usage

In an ES6+ environment you can either import the named export

import { fromCountryCode } from 'emoji-country-code'

or use the default export

import flagEmoji from 'emoji-country-code'

CommonJS and UMD builds are available as well.

API

To transform a country code like BD to 🇧🇩, just call the fromCountryCode function

const flag = flagEmoji.fromCountryCode('BD') //=> 🇧🇩

That's about it! Use it however you like 🚀


This project follows
JavaScript Style Guide