fa7ad / emoji-country-code

Transform ISO country codes to Emoji flags

Home Page:https://npm.im/emoji-country-code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Transform ISO country codes to Emoji flags

https://npm.im/emoji-country-code

License:MIT License


Languages

Language:JavaScript 100.0%