GLINR Studio LogoTypeWeaver

Core Functions

Essential JavaScript/TypeScript functions for profanity detection

Edit on GitHub

The core functions provide the primary interface for profanity detection in JavaScript and TypeScript applications.

checkProfanity

The primary function for comprehensive profanity detection.

function checkProfanity(
  text: string, 
  config?: ProfanityCheckerConfig
): ProfanityCheckResult

Basic Example

import { checkProfanity } from 'glin-profanity';

const result = checkProfanity("This is damn good!");
console.log(result.containsProfanity); // true
console.log(result.profaneWords); // ["damn"]

isWordProfane

Quick boolean check for individual words.

function isWordProfane(
  word: string, 
  config?: ProfanityCheckerConfig
): boolean

Basic Example

import { isWordProfane } from 'glin-profanity';

console.log(isWordProfane('hello')); // false
console.log(isWordProfane('damn')); // true

Cross-References