contains-emoji
- Simple NPM package that checks if a string contains one or more emojis 👀
- It uses Emoji Regex NPM module
- See examples below
NPM
Install via$ npm i contains-emoji
Usage
- Returns a Boolean indicating whether
string
contains one or more emojis.
const containsEmoji = require('contains-emoji');
const textWithEmoji = 'I love pizza 🍕';
if (containsEmoji(textWithEmoji)) {
console.log('Text contains one or more emojis!');
}