Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md to promote nicer functions #9

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`
Loading