Need help with emoji-flags?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

matiassingers
146 Stars 50 Forks MIT License 20 Commits 3 Opened issues

Description

return emoji flag symbol for country code

Services available

!
?

Need anything else?

Contributors list

# 10,739
Shell
Ruby
Sass
sass-mi...
17 commits
# 208,189
cart
Compose...
PHP
Laravel
1 commit
# 345,385
HTML
sitemap
automat...
Less
1 commit
# 563,229
Go
JavaScr...
1 commit

emoji-flags Build Status Dependency Status

return emoji flag symbol for country code

Install

$ npm install --save emoji-flags

Usage

var emojiFlags = require('emoji-flags');

// single country lookup by code emojiFlags.countryCode('DK'); // => { "code": "DK", "emoji": "🇩🇰", ... }

// entire dataset emojiFlags.data;

CLI

$ npm install --global emoji-flags
$ emoji-flags --help

return emoji flag symbol for country code

Example emoji-flags gb

emoji-flags dk --verbose

emoji-flags
=> returns the entire dataset

API

countryCode

Option

Type:

String

Default:
undefined

Takes an ISO 3166-1 alpha-2 code, and returns country details:

json
{
    "code": "DK",
    "emoji": "🇩🇰",
    "unicode": "U+1F1E9 U+1F1F0",
    "name": "Denmark",
    "title": "flag for Denmark"
}

Getters

The module exposes a bunch of simple getter methods: -

data
- returns the entire dataset -
emojis
- returns an array of all emojis -
codes
- returns an array of all country codes -
names
- returns an array of all country names -
unicodes
- returns an array of all emojis reprensented as unicode

Getter methods for all country codes:

js
emojiFlags.GB;
// => {
//      "code": "GB",
//      "emoji": "🇬🇧",
//      "unicode": "U+1F1EC U+1F1E7",
//      "name": "United Kingdom",
//      "title": "flag for United Kingdom"
//    }

License

MIT © Matias Singers

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.