npm.io
0.0.4 • Published 7 years ago

@pixim/emoji

Licence
AGPL-3.0-or-later
Version
0.0.4
Deps
0
Size
42 kB
Vulns
0
Weekly
0

@pixim/emoji

npm

Pixiv's custom emoji converter

Installation

npm i @pixim/emoji --save

Become a patron

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