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