项目作者: muan

项目描述 :
Emoji keyword library.
高级语言: JavaScript
项目地址: git://github.com/muan/emojilib.git
创建时间: 2013-12-26T19:30:18Z
项目社区:https://github.com/muan/emojilib

开源协议:MIT License

下载


" class="reference-link">emojilib CI status npm JavaScript Standard Style

Make emoji searchable with this keyword library.

Install

  1. npm install emojilib --save

Usage

  1. > require("emojilib")
  2. {
  3. '😀': [
  4. 'grinning_face',
  5. 'face',
  6. 'smile',
  7. 'happy',
  8. 'joy',
  9. ':D',
  10. 'grin'
  11. ],
  12. '😃': [
  13. 'grinning_face_with_big_eyes',
  14. 'face',
  15. 'happy',
  16. 'joy',
  17. 'haha',
  18. ...
  19. }

If you are looking for the unicode emoji dataset, including version, grouping, ordering, and skin tone support flag, check out unicode-emoji-json.

Migrating from 2.x

Previously:

  1. > var emoji = require("emojilib")
  2. > emoji.lib
  3. {
  4. "grinning": {
  5. "keywords": ["face", "smile", "happy", "joy"],
  6. "char": "😀",
  7. "fitzpatrick_scale": false,
  8. "category": "people"
  9. },
  10. ...
  11. }

Now, merge keywords with other metadata from unicode-emoji-json:

  1. > var data = require('unicode-emoji-json')
  2. > var keywordSet = require('emojilib')
  3. > for (const emoji in data) {
  4. data[emoji]['keywords'] = keywordSet[emoji]
  5. }
  6. > data['😀']
  7. {
  8. name: 'grinning face',
  9. slug: 'grinning_face',
  10. group: 'Smileys & Emotion',
  11. emoji_version: '1.0',
  12. unicode_version: '1.0',
  13. skin_tone_support: false,
  14. keywords: [ 'grinning_face', 'face', 'smile', 'happy', 'joy', ':D', 'grin' ]
  15. }

Previously:

  1. > var emoji = require("emojilib")
  2. > emoji.ordered
  3. [ 'grinning', 'grimacing', 'grin', 'joy', 'smiley', 'smile', 'sweat_smile', ...]

Now this data can be found in unicode-emoji-json:

  1. > var orderedEmoji = require('unicode-emoji-json/data-ordered-emoji')
  2. ['😀', '😃', '😄', '😁', '😆', '😅',...]

Previously:

  1. > var emoji = require("emojilib")
  2. > emoji.fitzpatrick_scale_modifiers
  3. [ '🏻', '🏼', '🏽', '🏾', '🏿' ]

Now this data can be found in unicode-emoji-json:

  1. > require('unicode-emoji-json/data-emoji-components')
  2. {
  3. light_skin_tone: '🏻',
  4. medium_light_skin_tone: '🏼',
  5. medium_skin_tone: '🏽',
  6. medium_dark_skin_tone: '🏾',
  7. dark_skin_tone: '🏿',
  8. red_hair: '🦰',
  9. curly_hair: '🦱',
  10. white_hair: '🦳',
  11. bald: '🦲'
  12. }

Previously:

  1. > require("emojilib").lib['v'].fitzpatrick_scale
  2. true
  3. > require("emojilib").lib['turtle'].fitzpatrick_scale
  4. false

Now this data can be found in unicode-emoji-json:

  1. > require('unicode-emoji-json')['✌️'].skin_tone_support
  2. true
  3. > require('unicode-emoji-json')['🐢'].skin_tone_support
  4. false

Development

See CONTRIBUTING.md.