Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sinansonmez authored Nov 3, 2023
1 parent 9a5105f commit faa47e6
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# easy-emojis
- Convert country codes (ISO 3166-1) to emoji flags or vice a versa
- Convert single letters to emojis or vice a versa

This package relies on `String.fromCodePoint`, and does not provide any polyfills.
Bunch of usefull functions to use emojis

## install

Expand All @@ -14,11 +12,6 @@ npm install easy-emojis
## usage
```javascript
import * as EasyEmojis from 'easy-emojis';
EasyEmojis.countryCodeToFlag('US'); // returns '๐Ÿ‡บ๐Ÿ‡ธ'
EasyEmojis.flagToCountryCode('๐Ÿ‡บ๐Ÿ‡ธ'); // returns 'US'

EasyEmojis.letterToEmoji('S'); // returns '๐Ÿ‡ธ'
EasyEmojis.emojiToLetter('๐Ÿ‡ธ') // returns 'S'

EasyEmojis.getRandomEmoji(); // should return a random emoji

Expand All @@ -28,7 +21,17 @@ EasyEmojis.getEmojiByShortName(':apple:'); // should return '๐ŸŽ'
// getEmoji both accepts name and short name
EasyEmojis.getEmoji('red apple'); // should return '๐ŸŽ'
EasyEmojis.getEmoji(':apple:'); // should return '๐ŸŽ'

EasyEmojis.countryCodeToFlag('US'); // returns '๐Ÿ‡บ๐Ÿ‡ธ'
EasyEmojis.flagToCountryCode('๐Ÿ‡บ๐Ÿ‡ธ'); // returns 'US'

EasyEmojis.letterToEmoji('S'); // returns '๐Ÿ‡ธ'
EasyEmojis.emojiToLetter('๐Ÿ‡ธ') // returns 'S'
```
- Convert country codes (ISO 3166-1) to emoji flags or vice a versa
- Convert single letters to emojis or vice a versa

This package relies on `String.fromCodePoint`, and does not provide any polyfills.

### Run tests
`npm run test`

0 comments on commit faa47e6

Please sign in to comment.