@groupher/emoji-search
v2.0.6
Published
Retrieve emojis based on the search term.
Downloads
19
Readme
@jukben/emoji-search
Exposes search function which returns arrays of related emojis:
type Emoji = {
category: string
char: string,
fitzpatrick_scale: boolean
keywords: Array<string>,
name: string,
}
(string) => Array<Emoji>
Based on emojilib and wonderful match-sorter.
Install
npm i --save-dev @jukben/emoji-search
Usage
import search from "@jukben/emoji-search"
search("beer") // [{"keywords":["beer", "relax","beverage","drink","drunk","party","pub","summer","alcohol","booze"],"char":"🍺","fitzpatrick_scale":false,"category":"food_and_drink", name: "beer"},{"keywords":["beers", "relax","beverage","drink","drunk","party","pub","summer","alcohol","booze"],"char":"🍻","fitzpatrick_scale":false,"category":"food_and_drink", name: beers"},{"keywords":["milk_glass", "beverage","drink","cow"],"char":"🥛","fitzpatrick_scale":false,"category":"food_and_drink", name: "milk_glass"},...
search("beer")[0].char // 🍺
License
MIT