uriteller
uriteller copied to clipboard
Publish the "country code -> flag emoji" helper as a separate library
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.
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).
uriteller used emoji-flags
earlier. The size was the reason why I removed it.
emoji-flag
depends on punycode2
. In our usecase (browser rendering) we can use String.fromCodePoint
instead?
In fact it seems that the part of punycode2
that emoji-flag
uses does its conversions with String.fromCodePoint.