to-emoji

2.0.2 • Public • Published

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.

Emoticon Emoji
:) 🙂
;) 😉
: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).

Package Sidebar

Install

npm i to-emoji

Weekly Downloads

49

Version

2.0.2

License

ISC

Unpacked Size

6.24 kB

Total Files

3

Last publish

Collaborators

  • devspen