Home

WordSensor is a simple and lightweight word filtering library for JavaScript/TypeScript. It helps you detect, replace, or remove forbidden words from text effortlessly

🚀 WordSensor

WordSensor is a simple, fast, and lightweight word filtering library for JavaScript and TypeScript. Whether you're building a chat app, a forum, or a content moderation system, WordSensor makes it easy to detect, replace, or remove forbidden words from any text input — with clean APIs and flexible customization.

No heavy dependencies, no overengineering — just efficient, modular, and extensible filtering built for modern web and Node.js applications.

✨ Features

Here’s what makes WordSensor powerful and easy to use:

🔍 Smart Word Detection
Easily scan any input text to detect prohibited or flagged words.

🚫 Flexible Word Masking
Automatically replace bad words with full or partial masking using characters you define.

🗑️ Word Removal Mode
Remove forbidden words completely from the text if you prefer a cleaner result.

📜 Custom Word Lists
Define your own list of words — whether it's for moderation, keyword tracking, or security purposes.

🔡 Case-Insensitive Matching
Detect words accurately regardless of capitalization (e.g., bad, Bad, BAD — all match).

📝 Built-in Logging
Optionally log which words were matched — useful for moderation review or audits.

📥 Async Word Loading
Dynamically load word lists from external APIs or databases — useful for apps that need real-time moderation rules.

Fully Tested with Jest
Reliable and production-ready — comes with a full suite of unit tests.


📦 NPM: https://www.npmjs.com/package/word-sensor
💻 GitHub: https://github.com/asruldev/word-sensor

Updated on