1.0.3 ā€¢ Published 3 years ago

textemoticons.js v1.0.3

Weekly downloads
5
License
-
Repository
github
Last release
3 years ago

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 :new:
  • Support for Emoji Modifier Sequences :new:
  • 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 :new:

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

Download Emoji text file from Unicode.org :new:

// 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"
}
1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.1

5 years ago