country-emoji
Converts between country names, ISO 3166-1 codes and flag emojis.
Usage
use ;
flag
// ~> ๐จ๐ฑ
code
// ~> CA
name
// ~> Qatar
// can extract name from stringโฆ
flag
// ~> ๐น๐ผ
// โฆbut only if there"s no ambiguity
flag
// ~> undefined
flag
// ~> ๐น๐ฟ
flag
// ~> ๐น๐ฟ
code
// ~> AU
code
// ~> AE
name
// ~> United Arab Emirates
code
// ~> GB
Don't want Rust?
Check out the following:
- JavaScript: country-emoji
- Swift: SwiftFlags (ref: #16)
Bugs and feedback
If you discover a bug please report it here. Express gratitude here.
Mail me at leodutra.br+foss@gmail.com, or on twitter @leodutra.
Credits
This library is based on the work of two existing library:
- country-emoji, available for JavaScript
- flag-emoji-from-country-code, a great snippet to get the emoji flag from an ISO 3166-1 region code
Thanks guys for your work!
License
MIT @ Leo Dutra