Because sometimes you want to use twemoji but without all the library bloat.
$ npm install twemoji-basename
var basename = require('twemoji-basename')
var template = '//twemoji.maxcdn.com/36x36/{basename}.png'
var image = new Image
image.src = template.replace('{basename}', basename('🇰🇷'))
document.body.appendChild(image)
compression | size |
---|---|
twemoji-basename.js | 1.02 kB |
twemoji-basename.min.js | 683 B |
twemoji-basename.min.js.gz | 412 B |