nomoji
v1.1.1
Published
Replace emojis in text with SVG images
Downloads
11
Readme
nomoji
Replace emojis in text with SVG images
installation
npm i nomoji
usage
nomoji(text, [prefix], [disableSanitation])
nomoji('Hello from 🇫🇮')
Hello from <img draggable="false" class="emoji" src="svg/1f1eb_1f1ee.svg">
The optional prefix parameter defines where to find image files
nomoji('Hello from 🇫🇮', 'nomoji/')
Hello from <img draggable="false" class="emoji" src="nomoji/svg/1f1eb_1f1ee.svg">
The optional disableSanitation parameter disables HTML sanitation
nomoji('Hello <b>HTML</b> 🤩!');
Hello <b>HTML</b> <img draggable="false" class="emoji" src="svg/1f929.svg">!
nomoji('Hello <b>HTML</b> 🤩!', null, true);
Hello <b>HTML</b> <img draggable="false" class="emoji" src="dist/svg/1f929.svg">!