Skip to content

Emoticon text codes to emoticons ๐ŸŽฑ โค๏ธ ๐Ÿš€

License

Notifications You must be signed in to change notification settings

loretoparisi/emoticons.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

emoticons.js

Emoticon text codes to emoticons ๐ŸŽฑ โค๏ธ ๐Ÿš€. It downloads official Emoji list from Unicode.org

What's new

  • Now it uses latest Unicode.org emojis ๐Ÿ†•
  • Support for Emoji Modifier Sequences ๐Ÿ†•
  • Added correct length calculation of a text containing Emoji

Install from npm

npm install textemoticons.js

Get Emoji from Emoticon Text Code

const EmoticonsJS = require('textemoticons.js');
var emoji = EmoticonsJS.emoji[ "pool_8_ball" ]
๐ŸŽฑ

Top Nearest emoji from Text

const EmoticonsJS = require('textemoticons.js');
EmoticonsJS.nearest("button", 10).then(emoji => console.log(emoji) )
[ 'โน', 'โธ', '๐Ÿ”˜', 'โบ', '๐Ÿ”ฒ', 'โญ', '๐Ÿš…', '๐Ÿ”ณ', 'โฏ', 'โฎ' ]

Fuzzy search Emoji from Text

const EmoticonsJS = require('textemoticons.js');
EmoticonsJS.match("cat", 10).then(emoji => console.log(emoji) )
[ '๐Ÿค ', '๐Ÿ˜ฐ', '๐ŸŽƒ', '๐Ÿ˜บ', '๐Ÿ˜ธ', '๐Ÿ˜น', '๐Ÿ˜ป', '๐Ÿ˜ผ', '๐Ÿ˜ฝ', '๐Ÿ™€' ]

Count length of text containing Emoji ๐Ÿ†•

const EmoticonsJS = require('textemoticons.js');
EmoticonsJS.length("Look at " + EmoticonsJS.emoji[ "point_down" ])
9

Download Emoji text file from Unicode.org ๐Ÿ†•

// Grab the latest version of Emoji from Unicode.org
EmoticonsJS.download({ version: '13.1' }).
then(emoji => {
    console.log(JSON.stringify( emoji, null, 2) );
})
.catch(error => {
    console.error(error);
})

Unicode.org Emoji text file

Array of emoji with Unicode point, emoji and description

{
    "codes": [
      "1F912"
    ],
    "emoji": "๐Ÿค’",
    "description": " fully-qualified     # ๐Ÿค’ E1.0 face with thermometer",
    "textcode": "face_with_thermometer"
}

It supports multiple codes as well:

{
    "codes": [
      "1F449",
      "1F3FB"
    ],
    "emoji": "๐Ÿ‘‰๐Ÿป",
    "description": " fully-qualified     # ๐Ÿ‘‰๐Ÿป E1.0 backhand index pointing right: light skin tone",
    "textcode": "backhand_index_pointing_right:_light_skin_tone"
}

Releases

No releases published

Packages

No packages published