custom-profanity-filter

1.0.3 • Public • Published

Profanity Filter

version downloads

NPM package available here.

Installation

npm install custom-profanity-filter

Usage

You will have to provide the custom list of bad words for the filter. Ensure that the custom list of bad words you want to filter is in an array format. customBadWords = ["custom", "list", "here"];

The filter is case insensitive and will pick up words part of a larger string.

const profanityFilter = require('custom-profanity-filter');

let customBadWords = ["custom1", "custom2", "custom3"];
let textToFilter = "This is some text with custom1 and CUSTOM2 and another custom1word without space.";

let filteredText = profanityFilter(textToFilter, customBadWords);
console.log(filteredText);  // Outputs the filtered text

Package Sidebar

Install

npm i custom-profanity-filter

Weekly Downloads

2

Version

1.0.3

License

ISC

Unpacked Size

2.17 kB

Total Files

3

Last publish

Collaborators

  • vithusha