has-emoji

Check whether a string has any emoji


Keywords
emoji, emojis, string, text, has, contains, includes, detect, is
License
MIT
Install
npm install has-emoji@3.0.0

Documentation

has-emoji

Check whether a string has any emoji

This can be useful when you need to prevent emoji in user input, for example, for usernames.

Install

npm install has-emoji

Usage

import hasEmoji from 'has-emoji';

hasEmoji('Unicorn 🦄');
//=> true

hasEmoji('Cat');
//=> false