Skip to content

๐Ÿ”๏ธ Retrieve emojis based on the search term

License

Notifications You must be signed in to change notification settings

jukben/emoji-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

33 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

@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