emojilib

Emoji keyword library.

MIT 44 个版本
安装
npm install emojilib
yarn add emojilib
pnpm add emojilib
bun add emojilib
README

emojilib CI status npm JavaScript Standard Style

Make emoji searchable with this keyword library.

Install

npm install emojilib --save

Usage

> require("emojilib")
{
  '😀': [
    'grinning_face',
    'face',
    'smile',
    'happy',
    'joy',
    ':D',
    'grin'
  ],
  '😃': [
    'grinning_face_with_big_eyes',
    'face',
    'happy',
    'joy',
    'haha',
  ...
}

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:

> var emoji = require("emojilib")
> emoji.lib
{
  "grinning": {
    "keywords": ["face", "smile", "happy", "joy"],
    "char": "😀",
    "fitzpatrick_scale": false,
    "category": "people"
  },
  ...
}

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

> var data = require('unicode-emoji-json')
> var keywordSet = require('emojilib')
> for (const emoji in data) {
data[emoji]['keywords'] = keywordSet[emoji]
}
> data['😀']
{
  name: 'grinning face',
  slug: 'grinning_face',
  group: 'Smileys & Emotion',
  emoji_version: '1.0',
  unicode_version: '1.0',
  skin_tone_support: false,
  keywords: [ 'grinning_face', 'face', 'smile', 'happy', 'joy', ':D', 'grin' ]
}

Previously:

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

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

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

Previously:

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

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

> require('unicode-emoji-json/data-emoji-components')
{
  light_skin_tone: '🏻',
  medium_light_skin_tone: '🏼',
  medium_skin_tone: '🏽',
  medium_dark_skin_tone: '🏾',
  dark_skin_tone: '🏿',
  red_hair: '🦰',
  curly_hair: '🦱',
  white_hair: '🦳',
  bald: '🦲'
}

Previously:

> require("emojilib").lib['v'].fitzpatrick_scale
true

> require("emojilib").lib['turtle'].fitzpatrick_scale
false

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

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

Development

See CONTRIBUTING.md.

版本列表
4.0.3 2026-04-18
4.0.2 2025-04-23
4.0.1 2024-12-13
4.0.0 2024-09-30
3.0.12 2024-03-28
3.0.11 2023-09-28
3.0.10 2023-04-02
3.0.9 2023-03-19
3.0.8 2022-12-17
3.0.7 2022-07-27
3.0.6 2022-03-15
3.0.5 2022-02-03
3.0.4 2021-07-20
3.0.3 2021-07-02
3.0.2 2021-05-06
3.0.1 2021-03-11
3.0.0 2021-01-14
2.4.0 2018-11-20
2.3.0 2018-07-18
2.2.12 2018-01-10
2.2.11 2018-01-10
2.2.9 2017-08-24
2.2.8 2017-08-21
2.2.7 2017-07-06
2.2.6 2017-06-20
2.2.5 2017-06-15
2.2.3 2017-06-12
2.2.2 2017-06-10
2.2.1 2017-03-31
2.2.0 2017-03-15
2.1.0 2017-02-13
2.0.7 2017-02-07
2.0.6 2017-02-02
2.0.5 2017-02-02
2.0.4 2017-01-11
2.0.3 2016-12-20
2.0.2 2016-01-29
2.0.1 2016-01-29
2.0.0 2016-01-29
1.1.0 2015-11-11
1.0.1 2015-08-25
1.0.0 2015-07-28
0.1.0 2015-07-12
0.0.4 2015-07-10