Emoji country flags to country code
Convert emoji country flags to country code ISO 3166.
Install
npm i emoji-flags-to-country
Example
const { flagToCountry, getFlagsInText } = require('emoji-flags-to-country');
const result1 = flagToCountry('๐ฎ๐น');
const result2 = flagToCountry('๐บ๐ธ');
const result3 = flagToCountry('๐ช๐ธ');
console.log(result1); // IT
console.log(result2); // US
console.log(result3); // ES
const result4 = getFlagsInText('This text has ๐บ๐ธ emoji flags ๐ฎ๐น');
console.log(result4); // ['๐บ๐ธ', '๐ฎ๐น'];
Run tests
npm test
Run lint
npm run lint