country-code-to-flag
v0.1.2
Published
Convert ISO 3166-1 alpha-2 code to emoji flag
Downloads
232
Readme
country-code-to-flag
Install
$ npm i country-code-to-flag
Usage
The function countryCodeToFlag
expect an ISO 3166-1 alpha-2 code
import countryCodeToFlag from "country-code-to-flag";
countryCodeToFlag("fr") // result: 🇫🇷
countryCodeToFlag("US") // result: 🇺🇸
countryCodeToFlag("USA") // throw an error 'the country code is invalid'
countryCodeToFlag('AA') // result: 🇦🇦