@sabir7718/abuse-detector
v1.0.1
Published
A powerful hybrid abuse/toxicity detection module for Node.js. Combines Aho-Corasick, fuzzy matching, phonetic normalization, and TensorFlow.js AI for accurate real-time content moderation.
Downloads
216
Maintainers
Readme
# Abuse Detector (VOIDSEC)
**A powerful, plug-and-play abuse/toxicity detection module for Node.js bots and APIs.**
Built with a hybrid detection system combining lightning-fast rule-based matching and advanced AI to catch toxic, abusive, and harmful content effectively.
---
## ✨ Features
- ⚡ **Ultra-fast keyword detection** using Aho-Corasick algorithm
- 🧠 **AI-Powered Toxicity Detection** with TensorFlow.js
- 🔍 **Fuzzy Matching** to catch typos and intentional misspellings
- 🗣️ **Phonetic Normalization** – resistant to common bypass techniques
- 📚 **Self-Learning System** – automatically learns new abusive patterns
- 🔌 **Easy Integration** – perfect for Discord bots, Telegram bots, APIs, and more
- 📊 **Detailed Results** with match type and confidence
---
## 📦 Installation
```bash
npm install @sabir7718/abuse-detector🚀 Quick Start
const abuse = require("@sabir7718/abuse-detector");
(async () => {
const result = await abuse.check("You are so stupid idiot!");
console.log(result);
})();Example Output
{
"abusive": true,
"type": "rule_match",
"category": "insult",
"matches": ["stupid", "idiot"],
"score": 0.95,
"fuzzy": null
}🤖 AI Detection Example
const result = await abuse.check("I hate you and want to kill you");
console.log(result);Output:
{
"abusive": true,
"type": "toxicity",
"score": 0.87,
"category": "threat"
}📚 Learning System
The module can automatically learn from new abusive content.
// Get pending entries for review
const pending = abuse.getPending();
console.log(pending);
// Approve or reject learned entries
abuse.approve(0); // Approve index 0
abuse.reject(1); // Reject index 1📁 Required Files
Create the following directories and files in your project root:
/database/
├── abuse.json
└── learning.jsonExample abuse.json structure:
{
"insult": [],
"profanity": [],
"sexual": [],
"threat": [],
"racism": []
}⚙️ How It Works
- Text Normalization – cleans and standardizes input
- Aho-Corasick Search – fast keyword matching
- Phonetic Analysis – detects bypass attempts
- Fuzzy Matching – Levenshtein distance for typos
- TensorFlow.js AI Model – fallback for complex cases
- Self-Learning – stores and learns new patterns
📋 Requirements
- Node.js 16 or higher
- TensorFlow.js (
@tensorflow/tfjs-noderecommended)
📜 License
© 2026 SeXyxeon (VOIDSEC)
All rights reserved.
This project is protected under copyright.
Allowed:
- Personal and commercial use with proper credit
Not Allowed:
- Redistribution
- Claiming as your own work
- Selling without permission
🔗 Connect With Me
- YouTube: https://youtube.com/@voidsec7718
- Instagram: sabir._7718
- Telegram: https://t.me/SABIR7718
- GitHub: https://github.com/SABIR7718
- WhatsApp: +91 73650 85213
⚠️ Disclaimer
This module is intended for moderation and content filtering purposes only. The author is not responsible for any misuse of this software.
Made with ❤️ for the developer community
