uriteller icon indicating copy to clipboard operation
uriteller copied to clipboard

Publish the "country code -> flag emoji" helper as a separate library

Open jviide opened this issue 8 years ago • 4 comments

Publish the "country code -> flag emoji" helper as a separate library, currently located at lib/country-flag.js.

Double-check that npm doesn't already have a replacement with a suitably small code side. If there is one, then use it instead.

jviide avatar Oct 27 '16 13:10 jviide

Quick search yielded two potential libraries:

  • emoji-flags
    • https://github.com/matiassingers/emoji-flags
  • emoji-flag
    • https://github.com/michaelrhodes/emoji-flag

I like the emoji-flag package. It's minimalistic. emoji-flags has ~40 kB JSON database of countries (which burden to keep up to date).

oherrala avatar Oct 28 '16 11:10 oherrala

uriteller used emoji-flags earlier. The size was the reason why I removed it.

jviide avatar Oct 28 '16 11:10 jviide

emoji-flag depends on punycode2. In our usecase (browser rendering) we can use String.fromCodePoint instead?

jviide avatar Oct 28 '16 11:10 jviide

In fact it seems that the part of punycode2 that emoji-flag uses does its conversions with String.fromCodePoint.

jviide avatar Oct 28 '16 11:10 jviide