New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details → →
Socket
Book a DemoSign in
Socket

content-guard

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

content-guard

🛡️ Advanced content analysis and moderation system with multi-variant optimization. Features context-aware detection, harassment prevention, and ML-powered toxicity analysis. Pre-1.0 development version.

latest
Source
npmnpm
Version
0.3.1
Version published
Maintainers
1
Created
Source

ContentGuard v0.3.1

Professional content moderation and spam detection for modern applications.

npm version License: MIT

ContentGuard analyzes text for spam, harassment and malicious patterns. It combines a powerful rule engine with optional machine‑learning plugins to deliver fast and accurate results across many languages.

Installation

npm install content-guard

Quick start

const { ContentGuard } = require('content-guard');
const guard = new ContentGuard('moderate');
const result = await guard.analyze('Hello world');
console.log(result.isSpam);

Key features

  • Multiple presets from lenient to strict
  • Context-aware detection using natural language processing
  • Pluggable rule engine with keyboard spam, sentiment and harassment filters
  • Optional ML plugins for emoji sentiment, cross‑cultural checks and toxicity analysis
  • Unicode confusables normalization to stop obfuscation attacks
  • CLI for batch processing and scripting
  • Lightweight and fast – suitable for serverless environments
  • TypeScript definitions included

v4.5 Variants

ContentGuard v4.5 ships four tuned variants so you can balance speed and accuracy:

VariantAccuracyAvg timeUse case
v4.5-turbo~91%0.02msReal‑time chat and high‑volume streams
v4.5-fast~91.5%0.06msAPI gateways and microservices
v4.5-balanced~93%0.25msGeneral production deployments (default)
v4.5-large~94%1.32msEnterprise and critical moderation

Select a variant when creating an instance or via the CLI.

Plugins and use cases

ContentGuard includes a modular plugin system. Enable only what you need:

PluginDescription & typical use case
ObscenityDetects offensive language. Use for community guidelines.
SentimentScores tone of text. Great for chat analytics.
HarassmentFlags bullying or hateful phrases. Essential for social apps.
Social EngineeringFinds phishing or scam attempts. Useful for email filters.
Keyboard SpamIdentifies random key mashing. Perfect for form submissions.
Emoji SentimentInterprets emoji tone. Adds nuance to sentiment analysis.
Cross‑CulturalChecks for culturally sensitive terms. Global deployments.
ML ToxicityMachine‑learning based toxicity scoring. Higher accuracy.
ConfusablesNormalizes look‑alike Unicode characters. Prevents obfuscation.

CLI usage

npx content-guard "Some text" --preset strict --variant fast

See the examples/ folder for integration samples.

Configuration

Each preset can be customized. Review lib/presets and adjust plugin weights, thresholds and preprocessing options to match your needs.

License

ContentGuard is released under the MIT License.

Other languages: Español | Français | 中文

Keywords

content-moderation

FAQs

Package last updated on 05 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts