Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davideviolante/emoji-flags-to-country
Convert emoji country flags to country code ISO 3166.
https://github.com/davideviolante/emoji-flags-to-country
character converter country emoji flags iso3166 javascript node
Last synced: about 2 months ago
JSON representation
Convert emoji country flags to country code ISO 3166.
- Host: GitHub
- URL: https://github.com/davideviolante/emoji-flags-to-country
- Owner: DavideViolante
- License: mit
- Created: 2019-10-16T12:48:57.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-01T07:17:08.000Z (3 months ago)
- Last Synced: 2024-10-12T17:14:35.340Z (2 months ago)
- Topics: character, converter, country, emoji, flags, iso3166, javascript, node
- Language: JavaScript
- Homepage:
- Size: 1.12 MB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Emoji country flags to country code
[![](https://github.com/davideviolante/emoji-flags-to-country/workflows/Node.js%20CI/badge.svg)](https://github.com/DavideViolante/emoji-flags-to-country/actions?query=workflow%3A"Node.js+CI") [![Coverage Status](https://coveralls.io/repos/github/DavideViolante/emoji-flags-to-country/badge.svg?branch=master)](https://coveralls.io/github/DavideViolante/emoji-flags-to-country?branch=master) [![Maintainability](https://api.codeclimate.com/v1/badges/958c5ceec39aadccb32a/maintainability)](https://codeclimate.com/github/DavideViolante/emoji-flags-to-country/maintainability) ![npm](https://img.shields.io/npm/dm/emoji-flags-to-country) [![Donate](https://img.shields.io/badge/paypal-donate-179BD7.svg)](https://www.paypal.me/dviolante)[![NPM](https://nodei.co/npm/emoji-flags-to-country.png)](https://nodei.co/npm/emoji-flags-to-country/)
Convert emoji country flags to country code ISO 3166.
### Install
`npm i emoji-flags-to-country`### Example
```js
const { flagToCountry, getFlagsInText } = require('emoji-flags-to-country');const result1 = flagToCountry('🇮🇹');
const result2 = flagToCountry('🇺🇸');
const result3 = flagToCountry('🇪🇸');
console.log(result1); // IT
console.log(result2); // US
console.log(result3); // ESconst result4 = getFlagsInText('This text has 🇺🇸 emoji flags 🇮🇹');
console.log(result4); // ['🇺🇸', '🇮🇹'];
```### Run tests
`npm test`### Run lint
`npm run lint`### Author
- [Davide Violante](https://github.com/DavideViolante/)