Replace emojis in text with SVG images (https://openmoji.org)
npm i nomoji
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">!
Code is licensed with MIT license, graphics (OpenMoji) are licensed with CC-BY-SA-4.0 license