Skip to content

Commit

Permalink
Merge pull request #9 from sinansonmez/sinansonmez-patch-2
Browse files Browse the repository at this point in the history
Update README.md to promote nicer functions
  • Loading branch information
sinansonmez authored Nov 3, 2023
2 parents 9a5105f + faa47e6 commit c8a9764
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 c8a9764

Please sign in to comment.