return emoji flag symbol for country code
Install
$ npm install --save emoji-flags
Usage
var emojiFlags = ; // single country lookup by codeemojiFlags;// => { "code": "DK", "emoji": "🇩🇰", ... } // entire datasetemojiFlagsdata;
CLI
$ npm install --global emoji-flags
$ emoji-flags --help return emoji flag symbol
API
countryCode
Option
Type: String
Default: undefined
Takes an ISO 3166-1 alpha-2 code, and returns country details:
Getters
The module exposes a bunch of simple getter methods:
data
- returns the entire datasetemojis
- returns an array of all emojiscodes
- returns an array of all country codesnames
- returns an array of all country namesunicodes
- returns an array of all emojis reprensented as unicode
Getter methods for all country codes:
emojiFlagsGB;// => {// "code": "GB",// "emoji": "🇬🇧",// "unicode": "U+1F1EC U+1F1E7",// "name": "United Kingdom",// "title": "flag for United Kingdom"// }
License
MIT © Matias Singers