https://github.com/madlittlemods/emoji-unicode-version
Get the unicode version for a given emoji name
https://github.com/madlittlemods/emoji-unicode-version
Last synced: 3 days ago
JSON representation
Get the unicode version for a given emoji name
- Host: GitHub
- URL: https://github.com/madlittlemods/emoji-unicode-version
- Owner: MadLittleMods
- Created: 2017-02-07T06:47:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-02T23:26:20.000Z (over 2 years ago)
- Last Synced: 2025-05-22T15:32:16.191Z (26 days ago)
- Language: JavaScript
- Size: 236 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/emoji-unicode-version)
# emoji-unicode-version
Get the unicode version for a given emoji name.
Useful for testing native unicode emoji support. Test a single emoji and assume any other emoji with that same version is supported.
```
npm install emoji-unicode-version
```# Usage
```js
const emojiNameToUnicodeVersion = require('emoji-unicode-version');// 6.1
console.log(emojiNameToUnicodeVersion('grinning'));
// 9.0
console.log(emojiNameToUnicodeVersion('rofl'));
```### Get version from unicode
```js
const emojiNameToUnicodeVersion = require('emoji-unicode-version');
const emojione = require('emojione');function unicodeToName(emojiUnicode) {
const emojiShortName = emojione.toShort(emojiUnicode);
const emojiName = emojiShortName.slice(1, emojiShortName.length - 1);
return emojiName;
}// grinning, 6.1
console.log(emojiNameToUnicodeVersion(unicodeToName('😀')));
// rofl, 9.0
console.log(emojiNameToUnicodeVersion(unicodeToName('🤣')));
```# About
Emoji name list is pulled from [EmojiOne](https://github.com/Ranks/emojione)
We grab the emoji unicode versions from [Emojipedia](http://emojipedia.org/unicode-6.1/).
[ZWJ sequences](http://emojipedia.org/emoji-zwj-sequences/) use the unicode version for the highest individual emoji in the sequence.
Also See
- http://unicode.org/emoji/charts-beta/full-emoji-list.html
- http://www.unicode.org/Public/emoji/5.0/emoji-data.txt
- http://unicode.org/Public/emoji/5.0/emoji-zwj-sequences.txt