Git Product home page Git Product logo

country-flag-emoji's Introduction

Country Flag Emoji

Build Status Test Covarage Latest Version

List of country codes and its flag emojis.

Installation

$ npm install country-flag-emoji

CDN

The library is available over a CDN:

<script src="https://unpkg.com/country-flag-emoji@latest/dist/country-flag-emoji.umd.js"></script>

<!-- Or the minified version -->
<script src="https://unpkg.com/country-flag-emoji@latest/dist/country-flag-emoji.umd.min.js"></script>

Usage

import countryFlagEmoji from "country-flag-emoji";

// All country flag emojis keyed by country code
console.log(countryFlagEmoji.data);

// Array of all country flag emojis
console.log(countryFlagEmoji.list);

// Array of country codes
console.log(countryFlagEmoji.countryCodes);

// Get country flag emoji for the given country code
console.log(countryFlagEmoji.get("US"));
// US: {
//  code: "US",
//  unicode: "U+1F1FA U+1F1F8",
//  name: "United States",
//  emoji: "๐Ÿ‡บ๐Ÿ‡ธ"
// }

API

data Property

Get all country flag emojis keyed by country code.

countryFlagEmoji.data

Data format:

{
  //...
  ID: {
    code: "ID",
    unicode: "U+1F1EE U+1F1E9",
    name: "Indonesia",
    emoji: "๐Ÿ‡ฎ๐Ÿ‡ฉ"
  },
  IE: {
    code: "IE",
    unicode: "U+1F1EE U+1F1EA",
    name: "Ireland",
    emoji: "๐Ÿ‡ฎ๐Ÿ‡ช"
  },
  //...
}

list Property

Get all country flag emojis.

countryFlagEmoji.list

Data format:

[
  //...
  {
    code: "ID",
    unicode: "U+1F1EE U+1F1E9",
    name: "Indonesia",
    emoji: "๐Ÿ‡ฎ๐Ÿ‡ฉ"
  },
  {
    code: "IE",
    unicode: "U+1F1EE U+1F1EA",
    name: "Ireland",
    emoji: "๐Ÿ‡ฎ๐Ÿ‡ช"
  },
  //...
]

countryCodes Property

Get all country codes.

countryFlagEmoji.countryCodes

Data format:

[..., "IC", "ID", "IE", ...]

get() Method

countryFlagEmoji.get([countryCode])

Parameters

Returns

There are three possible return types:

  • Array: If no countryCode being passed, it returns array of all country flag emojis.
  • undefined: If the given country code is not found.
  • Object: If the emoji is found for the given country code. The returned object has 4 properties:
    • code: The two-letter country code in ISO 3166-1 alpha-2 format.
    • unicode: Flag emoji Unicode character sequence, e.g. U+1F1EE U+1F1E9. Read more about Regional Indicator Symbol.
    • name: The country name.
    • emoji: The country flag emoji.

Related

License

MIT ยฉ Risan Bagja Pradana

country-flag-emoji's People

Contributors

greenkeeper[bot] avatar risan 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

Watchers

 avatar  avatar  avatar

country-flag-emoji's Issues

An in-range update of rollup is breaking the build ๐Ÿšจ

The devDependency rollup was updated from 1.4.1 to 1.4.2.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v1.4.2

2019-03-07

Bug Fixes

  • Respect variable identity of exports when hashing (#2741)
  • Resolve a situations where a variable was imported twice with the same name (#2737)

Pull Requests

Commits

The new version differs by 6 commits.

  • adaa23e 1.4.2
  • 2d03a67 Update changelog
  • 858fea4 Resolve a situation where different default exports referencing the same (#2737)
  • 6903425 Update changelog
  • af41561 Fix an issue where the same hash was generated when different variables (#2741)
  • d27c0f6 Docs: Fix return type (#2738)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

Include constituent countries of the UK

โค๏ธ this library!

It might be nice to include the UK's constituent countries as wellโ€”I'm in Scotland and sometimes that distinction can be quite important!

๐Ÿด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ฟ Scotland (GB-SCT)
๐Ÿด๓ ง๓ ข๓ ท๓ ฌ๓ ณ๓ ฟ Wales (GB-CYM)
๐Ÿด๓ ง๓ ข๓ ฅ๓ ฎ๓ ง๓ ฟ England (GB-ENG)
Northern Ireland (GB-NIR)

Northern Ireland is often classed as a province rather than a country, which may be why it's lacking its own emoji, but I know Wales only acquired their emoji relatively recently, so it may be in the works.

If you'd consider adding this to the library, I'd be happy to help facilitate as much as I can!

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.