2.0.2 • Published 2 years ago

to-emoji v2.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

to-emoji

A lightweight package to easily convert strings to emojis, and vice-versa.

Installation

npm install to-emoji

Functions

emojify()

const emoji = require("to-emoji")
emoji.emojify("hello world")
//returns 🇭 🇪 🇱 🇱 🇴    🇼 🇴 🇷 🇱 🇩

deemojify()

const emoji = require("to-emoji")
emoji.deemojify("🇭 🇪 🇱 🇱 🇴    🇼 🇴 🇷 🇱 🇩")
//returns "hello world"

emoticonToEmoji()

const emoji = require("to-emoji")
emoji.emoticonToEmoji(":) ;) :')")
//returns "🙂 😉 😂"

emojiToEmoticon()

const emoji = require("to-emoji")
emoji.emojiToEmoticon("🙂 😉 😂")
//returns ":) ;) :')"

Resources

Emoji Conversion List

Uses the same as Discord's "convert emoticons to emojis" setting.

EmoticonEmoji
:)🙂
;)😉
:D😄
:O😮
:|😐
:,(😢
:'(😢
>:(😠
:P😛
,:)😅
:$😒
:@😡
<3❤️
:(😦
:')😂
:,)😂
,:(😓

Notice

There is a space between each emojified character, and 2 spaces per space inputted (you can adjust this using .replace() if needed, but generally it's optimized; especially for Discord bots).