• Stars
    star
    168
  • Rank 218,463 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 9 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

return emoji flag symbol for country code

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:

{
    "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:

emojiFlags.GB;
// => {
//      "code": "GB",
//      "emoji": "πŸ‡¬πŸ‡§",
//      "unicode": "U+1F1EC U+1F1E7",
//      "name": "United Kingdom",
//      "title": "flag for United Kingdom"
//    }

License

MIT Β© Matias Singers

More Repositories

1

awesome-readme

A curated list of awesome READMEs
17,076
star
2

awesome-slack

A curated list of awesome Slack related things
831
star
3

spotify-pricing

The Big Mac Index for Spotify Premium pricing
JavaScript
110
star
4

spotify-crawler

Returns pricing data for all available Spotify countries
JavaScript
43
star
5

ipa-metadata

extract metadata and provisioning information about an .ipa file
JavaScript
32
star
6

scene-release

parse scene release names
JavaScript
25
star
7

slack-currency

slack command for converting currency
JavaScript
21
star
8

youtube-thumbnail

get thumbnail images for youtube videos
JavaScript
15
star
9

slack-movie

slack command for showing movie data
JavaScript
14
star
10

grunt-xcode

build and export Xcode projects with Grunt
Objective-C
12
star
11

kuala-lumpur

things to know when visiting Kuala Lumpur
11
star
12

provisioning

parse .mobileprovision (iOS) and .provisionprofile (OS X) files
JavaScript
10
star
13

apn-test

quickly test push notifications
JavaScript
10
star
14

sass-color-calculator

calculate the Sass color functions required to get one color from a base color
JavaScript
9
star
15

destinations

curated list of awesome travel destination repos
9
star
16

generator-slack-command

start a simple Slack slash command server
JavaScript
8
star
17

whatsapp-log-parser

parse WhatsApp log files
JavaScript
7
star
18

generator-simple-node-package

start a simple node module project, including CLI
JavaScript
4
star
19

kl-parking-spots

available parking spots in Kuala Lumpur
JavaScript
4
star
20

octicons-glyphsearch-crawler

Crawls the GitHub Octicons website and formats it for GlyphSearch
JavaScript
3
star
21

color-delta

calculate the diff between 2 colors
JavaScript
3
star
22

entitlements

check the entitlements of a .app bundle
JavaScript
3
star
23

textual-log-parser

parses Textual log files and returns JavaScript objects
JavaScript
2
star
24

spotify-countries

list of countries that Spotify is available in
HTML
2
star
25

stripe-countries

list of countries that Stripe is available in, and their current status
JavaScript
2
star
26

dotfiles

Shell
2
star
27

airport-lookup

lookup airport details by IATA code
JavaScript
2
star
28

sg-parking-spots

available parking spots in Singapore
JavaScript
1
star
29

opml

1
star
30

generator-sass-library

start a simple Sass library
JavaScript
1
star
31

statsministeriet-speeches-scraper

scrape speeches from the Danish Interior Ministry website
JavaScript
1
star