sindresorhus / has-emoji

Check whether a string has any emoji

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Related

About

Check whether a string has any emoji

License:MIT License


Languages

Language:JavaScript 74.7%Language:TypeScript 25.3%