https://github.com/fa7ad/emoji-country-code
Transform ISO country codes to Emoji flags
https://github.com/fa7ad/emoji-country-code
code country emoji flag iso-3166-1 pure-javascript
Last synced: 5 months ago
JSON representation
Transform ISO country codes to Emoji flags
- Host: GitHub
- URL: https://github.com/fa7ad/emoji-country-code
- Owner: fa7ad
- License: mit
- Created: 2019-10-19T17:48:43.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-25T12:10:22.000Z (about 1 year ago)
- Last Synced: 2025-04-19T20:56:08.531Z (6 months ago)
- Topics: code, country, emoji, flag, iso-3166-1, pure-javascript
- Language: JavaScript
- Homepage: https://npm.im/emoji-country-code
- Size: 1.54 MB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# emoji-country-code
Transform ISO 3166-1 country codes to Emoji flags## Installation
Installation is the same as any other npm module.
```bash
yarn add emoji-country-code
```or
```bash
npm install --save emoji-country-code
```## Usage
In an ES6+ environment you can either import the named export
```js
import { fromCountryCode } from 'emoji-country-code'
```or use the default export
```js
import flagEmoji from 'emoji-country-code'
```CommonJS and UMD builds are available as well.
## API
To transform a country code like `BD` to `🇧🇩`, just call the `fromCountryCode` function
```js
const flag = flagEmoji.fromCountryCode('BD') //=> 🇧🇩
```That's about it! Use it however you like 🚀
---
This project follows
[](https://github.com/standard/standard)