emoji-translator
v1.0.1
Published
Translate emojis into meaningful text strings providing your own vocabulary
Downloads
33
Readme
emoji-translator
Installation
npm i emoji-translator -S
API
Table of Contents
create
Create a translator function that can be used to replace the emoji
Parameters
vocabulary
Object emoji vocabulary map
Examples
import translator from 'emoji-translator';
const vocabulary = { '🍏': 'Apple', '🍋': 'Lemon', '🍌': 'Banana' };
const translate = translator(vocabulary)
const string = translate('A 🍌 is normally sweeter than an 🍏')
console.log(string) // A Banana is normally sweeter than an Apple
Returns Function the translation function converting strings containing emoji to plain text