Giter VIP home page Giter VIP logo

emoji-flags's Introduction

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

emoji-flags's People

Contributors

fshiori avatar lc512k avatar matiassingers avatar selahattinunlu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emoji-flags's Issues

How to display on Windows 10?

The emoji-flags do not appear on either Chrome or Edge in Windows 10. They work fine Chrome in Mac.

Below is a screen grab from Chrome on Windows 10. I'm just displaying the single flag row in a tag and below that is HTML.

      <pre>{JSON.stringify({code: 'AR', emoji: '๐Ÿ‡ฆ๐Ÿ‡ท', unicode: 'U+1F1E6 U+1F1F7', name: 'Argentina', title: 'flag for Argentina'}, null, 2)}</pre>
      <p>I will display &#129409;</p>
      <p>I will display &#x1F981;</p>

image

From my testing, the emoji value will not display, but the HTML equivalent will. Is there a configuration value that I might use for this?

A country is missing

Hi, just noticed your data misses Kosovo.

By the tip, added Emoji to our Countries data library build, but see that this country is missing. Could you please check it out?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.