1.0.2 • Published 6 years ago

emoti-generator v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

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": "😘"
    }
]
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago