emojilib Documentation

repository·main·Indexed 23 days ago

https://github.com/muan/emojilib

A keyword library for emojilib version 4.0.3 that provides a mapping between emoji characters and associated text keywords to enable emoji searching.

Tokens
423
Snippets
2
Records
4
Agent score
33%

What's inside emojilib

  1. Migrate from emojilib 2.x to current version

    main

    In current versions, emojilib focuses strictly on the keyword mapping. Other metadata (like categories, skin tone support, and ordering) has been moved to the unicode-emoji-json package.

    To reconstruct the full emoji dataset, you must merge the keywords from emojilib with the 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]
    }
    
    // Now data[emoji] contains both unicode metadata and emojilib keywords
  2. Retrieve ordered emojis and skin tone modifiers via unicode-emoji-json

    main

    If you are migrating from 2.x, note that the following data is no longer provided by emojilib and must be sourced from unicode-emoji-json:

    • Ordered emoji list: Use require('unicode-emoji-json/data-ordered-emoji').
    • Skin tone modifiers (Fitzpatrick scale): Use require('unicode-emoji-json/data-emoji-components').
    • Skin tone support flags: Check the skin_tone_support property on the emoji object within unicode-emoji-json.
  3. Use emojilib to search emoji by keywords

    main
    By default, requiring emojilib returns a mapping where keys are emoji characters and values are arrays of associated keywords. This allows you to implement emoji searching based on user input.