GithubHelp home page GithubHelp logo

alixaxel / emoji-flags Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matiassingers/emoji-flags

0.0 2.0 0.0 65 KB

return emoji flag symbol for country code

License: MIT License

JavaScript 100.00%

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

matiassingers avatar lc512k avatar

Watchers

James Cloos avatar  avatar

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.