Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

emojis

tallesl1.9kFairdeprecated1.0.10

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

Replaces emoji codes to images.

emoji, emojis, replace, text

readme

emojis

Replaces emoji codes (like :smiley:) for emoji images (like :smiley:) or unicode characters (like 😃).

Usage

$ npm install emojis
(...)
$ node
> let emojis = require('emojis')
undefined
> emojis.unicode('I :heart: you!')
'I ❤️ you!'
> emojis.html('I :heart: you!', 'http://example.org/images/')
'I <img class="emoji" width="20" height="20" src="http://example.org/images/heart.png" alt="heart"> you!'

Emoji codes and images

The emoji codes used are the ones on Emoji cheat sheet. Their images are also provided here for you to use (images.zip), but consider its copyright.

Aligning the HTML image

One way to align the emoji image within the text would be using align="absmiddle", just as GitHub does, but I didn't do it because it's obsolete.

A suggestion is to use the following CSS:

.emoji {
  margin-bottom: .25em;
  vertical-align: middle;
}