emoti-generator
v1.0.2
Published
An awesome emoti generator module
Downloads
2
Readme
emoti-generator
This module returns a emoti object with this structure:
{
"name": "smiley",
"description": "happy; joy; haha",
"code": "\\\\ud83d\\\\ude03",
"emoti": "😃"
}
Usage
Just require the module like any other npm module
const emotiGenerator = require('emoti-generator');
Methods
This module has two methods:
- getEmotiByDescription: get emoti from String description
- getEmotiByName: get emoti from String name
Example
const { getEmotiByDescription, getEmotiByName } = require('emoti-generator');
const smiley = getEmotiByName('smiley');
console.log(JSON.stringify(smiley, null, 4));
Output:
[
{
"name": "smiley",
"description": "happy; joy; haha",
"code": "\\\\ud83d\\\\ude03",
"emoti": "😃"
}
]
const flirt = getEmotiByDescription('flirt');
console.log(JSON.stringify(flirt, null, 4));
Output:
[
{
"name": "wink",
"description": "flirt",
"code": "\\\\ud83d\\\\ude09",
"emoti": "😉"
},
{
"name": "kissing_heart",
"description": "flirt",
"code": "\\\\ud83d\\\\ude18",
"emoti": "😘"
}
]