0.0.4 • Published 5 years ago

@pixim/emoji v0.0.4

Weekly downloads
1
License
AGPL-3.0-or-later
Repository
github
Last release
5 years ago

@pixim/emoji

npm

Pixiv's custom emoji converter

Installation

npm i @pixim/emoji --save

Usage

emoijfy

Convert emoji keywords (e.g. (heart)) to HTML img elements.

import { emojify } from '@pixim/emoji';

emojify('I like this! (heart)');
// -> 'I like this! <img class="__pixiv-emoji" src="https://s.pximg.net/common/images/emoji/501.png" alt="heart" title="heart">'

stringify

The contrary of emojify

import { stringify } from '@pixim/emoji';

stringify('I like this! <img class="__pixiv-emoji" src="https://s.pximg.net/common/images/emoji/501.png" alt="heart" title="heart">');
// -> 'I like this! (heart)'

License

AGPL v3