JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q48364F
  • License ISC

This is a packege that filters bad words

Package Exports

  • @tenapato/profanity-filter
  • @tenapato/profanity-filter/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@tenapato/profanity-filter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Profanity Filter

version 1.0.1

This project is a profanity filter that detects and filters out offensive words and phrases from text. It supports multiple languages and includes leetspeak normalization.

Features

  • Detects offensive words and phrases in text
  • Supports multiple languages
  • Normalizes leetspeak
  • Customizable profanity word list

Installation

  1. Install the package:
    npm install @tenapato/profanity-filter

Usage

Basic Usage

import  ProfanityFilter  from 'profanity-filter'

const filter = new ProfanityFilter();
const word = "Your word here";
const isProfane = filter.isProfane(word);

console.log(`Is the word profane? ${isProfane}`);

Custom Options

You can customize the filter by passing options to the constructor:

const filter = new ProfanityFilter({
    langs: ['eng', 'spanish'], // languages
    threshold: 2, // Levenshtein distance threshold
    debug: true // Enable debug logging
});

Supported Languages

  • English
  • Spanish

Adding Custom Profane Words

You can add custom profane words to the filter:

filter.addProfaneWord('customword');