Skip to content

🧰 Collection of utility functions wrapped around emojis supported by Windows.

License

Notifications You must be signed in to change notification settings

emigrek/winemoji

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

winemoji

NPM Version NPM Downloads GitHub GitHub code size in bytes

Collection of utility functions wrapped around emojis supported by Windows. Built with emoji data from winmojilib package.

Installation

npm install winemoji

Usage

Variables

import { emojis } from 'winemoji';

emojis
/*
    [
        { 
            char: 'πŸ˜€', 
            group: 'smileys-emotion', 
            hexcode: '1F600', 
            keywords: ['face', 'grin', 'grinning face'],
            name: 'grinning_face',
            subgroup: 'face-smiling' 
        }, ...
    ]
*/

Enums

import { Groups } from 'winemoji';

Groups
/*
    {
        AnimalsAndNature = 'animals-nature',
        SmileysAndEmotion = 'smileys-emotion',
        FoodAndDrink = 'food-drink',
        ...
    }
*/
import { Subgroups } from 'winemoji';

Subgroups
/*
    {
        Drink = 'drink',
        Clothing = 'clothing',
        HairStyle = 'hair-style',
        ...
    }
*/

Functions

import { resolveEmoji } from "winemoji";

resolveEmoji("frog")
resolveEmoji("🐸")
resolveEmoji("1F438")
/*
    { 
        char: '🐸', 
        group: 'animals-nature', 
        hexcode: '1F438', 
        keywords: ['animal', 'face', 'frog'],
        name: 'frog_face',
        subgroup: 'animal-amphibian' 
    }
*/
import { getRandomEmoji } from "winemoji";

getRandomEmoji()
/*
    {
        char: 'πŸ’œ',
        keywords: [ 'purple', 'purple heart' ],
        name: 'purple_heart',
        group: 'smileys-emotion',
        hexcode: '1F49C',
        subgroup: 'emotion'
    }
*/
import { getSimilarEmojis } from "winemoji";

getSimilarEmojis("🍳")
/*
    [
        {
            emoji: {
                char: 'πŸ₯š',
                ...
            },
            similarity: 0.4
        },
        {
            emoji: {
                char: 'πŸ₯',
                ...
            },
            similarity: 0.2
        },
        {
            emoji: {
                char: 'πŸ₯―' ,
                ...
            },
            similarity: 0.2
        },
        ...
    ]
*/
import { getRandomSimilarEmoji } from "winemoji";

getRandomSimilarEmoji("🍳")
/*
    {
        emoji: {
            char: 'πŸ₯š',
            ...
        },
        similarity: 0.4
    }
*/
import { getEmojisMatchingKeyword } from "winemoji";

getEmojisMatchingKeyword("ball")
/*
[
    {
        char: '⚽',
        ...
    },
    {
        char: '⚾',
        ...
    },
    {
        char: 'πŸ₯Ž' ,
        ...
    },
    ...
]
*/
import { getEmojisMatchingKeywords } from "winemoji";

getEmojisMatchingKeywords(["chocolate","bar"])
/*
    [
        {
            char: '🍫',
            keywords: [ 'bar', 'chocolate', 'dessert', 'sweet' ],
            name: 'chocolate_bar',
            group: 'food-drink',
            hexcode: '1F36B',
            subgroup: 'food-sweet'
        }
    ]
*/
import { getEmojisFromGroup, Groups } from "winemoji";

getEmojisFromGroup(Groups.AnimalsAndNature);
/*
    [
        {
            char: '🐡',
            ...
        },
        {
            char: 'πŸ’',
            ...
        },
        {
            char: '🦍',
            ...
        },
        ...
    ]
*/
import { getEmojisFromSubgroup, Subgroups } from "winemoji";

getEmojisFromSubgroup(Subgroups.Music);
/*
    [
        {
            char: '🎼',
            ...
        },
        {
            char: '🎡',
            ...
        },
        {
            char: '🎢',
            ...
        },
        ...
    ]
*/

About

🧰 Collection of utility functions wrapped around emojis supported by Windows.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published