country-code-to-flag-emoji
country-code-to-flag-emoji copied to clipboard
A function that returns a flag emoji given IETF language tag.
Country-Code-to-Flag-Emoji
A function that returns a flag emoji given IETF language tag.
tl;dr
- Install by executing
npm install country-code-to-flag-emoji
oryarn add country-code-to-flag-emoji
. - Import by adding
import countryCodeToFlagEmoji from 'country-code-to-flag-emoji'
. - Do stuff with it!
countryCodeToFlagEmoji('pl'); // 🇵🇱
Accepted formats
-
IETF language tag, e.g.
'en-US'
or'US'
Examples
> countryCodeToFlagEmoji('pl');
< '🇵🇱'
> countryCodeToFlagEmoji('hu-HU');
< '🇭🇺'
License
The MIT License.
Author
![]() |
Wojciech Maj [email protected] https://wojtekmaj.pl |