Replace emoji in your strings with images from the Apple Color Emoji c
npm install apple-color-emoji-catalina-10155Extracts emoji images from the Apple Color Emoji font using fontkit,
and generates a regular expression from mac catalina 10.15.5 that can be used to replace emoji in strings with tags if
the current browser or platform does not have native support.
npm install apple-color-emoji-catalina-10155
``javascript
var emoji = require('apple-color-emoji-catalina-10155');
// configure
emoji.imageDir // the directory where the images are located (on the server)
emoji.basePath // the base path or URL where images are located
// check for native support
if (emoji.nativeSupport) { / ... / }
// replace an emoji in a string with an
// (only if there is no native support in the browser)
emoji.replace('this is an 🍎') //=> 'this is an
'
// you can also get an image URL for a particular emoji character
emoji.getImage('😀') //=> "/path/to/d83d-de00.png"
// if you don't like tags, you can use the regex directly
myString.replace(emoji.regex, function(char) {
return '';
});
``
MIT