-
Notifications
You must be signed in to change notification settings - Fork 9
Home
Federico Ballarini edited this page Jul 3, 2019
·
1 revision
npm i smile2emoji
Right now, there are 2 simple ways to use it.
With the function to get the data from the map:
import { checkText } from 'smile2emoji'
...
const text = checkText(':)');
console.log(text) //prints '😊'
//OR
const text = checkText('i like bananas :)');
console.log(text) //prints 'i like bananas 😊'
Or from the map:
import { emojiMap } from 'smile2emoji'
...
const text = ':)';
const emoji = emojiMap[text];
console.log(emoji) //prints '😊'