@devsnowflake/text-emoji-parser

Simple javascript package to parse emojis from text.

Usage no npm install needed!

<script type="module">
  import devsnowflakeTextEmojiParser from 'https://cdn.skypack.dev/@devsnowflake/text-emoji-parser';
</script>

README

Text Emoji Parser

Simple JavaScript library to parse emojis from the given text. This package is based on twemoji-parser.

Example

const { parse } = require("@devsnowflake/text-emoji-parser");
const entities = parse("Hello ๐Ÿ˜€ I ๐Ÿงก Emojis ๐Ÿค—");

console.log(entities);

/*
[
    {
        indices: [ 6, 8 ],
        text: '๐Ÿ˜€',
        type: 'emoji',
        unicode: '1f600'
    },
    {
        indices: [ 11, 13 ],
        text: '๐Ÿงก',
        type: 'emoji',
        unicode: '1f9e1'
    },
    {
        indices: [ 21, 23 ],
        text: '๐Ÿค—',
        type: 'emoji',
        unicode: '1f917'
    }
]
*/