1.0.1 • Published 5 months ago
emoji-remover v1.0.1
Emoji Stripper / Remover
Description
This Node.js package removes all emojis from a given text string using Unicode regex, with built-in error handling and no external dependencies.
Installation
npm install emoji-remover
Usage
const emojiStripper = require('emoji-remover');
const textWithEmojis = 'Hello 😊, how are you? 🤔';
const cleanText = emojiStripper.stripEmojis(textWithEmojis);
console.log(cleanText); // Output: "Hello , how are you? "
Functions
stripEmojis(text)
- Removes all emojis from the input string.- Parameters:
text
(string) - The input text. - Returns: A string with all emojis removed.
- Parameters:
Error Handling
- Throws a
TypeError
if the input is not a string. - Logs errors and returns the original text if an exception occurs.
License
This project is licensed under the MIT License.