populate-emoji

Populate text with Emoji characters

Usage no npm install needed!

<script type="module">
  import populateEmoji from 'https://cdn.skypack.dev/populate-emoji';
</script>

README

Populate Emoji

Description

Populate a string of text with more than 3,100 Emoji characters!

Installation

To install, simply run:

npm install --save populate-emoji

Or, if using Yarn:

yarn add populate-emoji

Usage

Using Populate Emoji is super easy!

import populateEmoji from 'populate-emoji';

const text = 'Hello! ::grinning face::. I hope you are awesome today!';

const emojiText = populateEmoji(text);

console.log(emojiText);

// > Hello! 😀. I hope you are awesome today!

Emoji names must be denoted between :: tags (though optional tags will be added soon).

Emoji Names

The Emoji list is currently sourced from emojipedia.org and uses their naming conventions. Certain conventions must be observed, however.

"Index Pointing Up: Medium Skin Tone" should be written as "Index Pointing Up Medium Skin Tone", without the additional colon. Emoji names are also case-insensitive, so "index pointing up medium skin tone" will also work!

Additionally, "One O’Clock" should be written as "One OClock".

Note: Updates to this functionality will be made soon.