Giter VIP home page Giter VIP logo

emoticons.js's Introduction

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

emoticons.js's People

Contributors

loretoparisi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.