simple-profanity-filter-with-whitelist
A very simple JS profanity filter. Replaces profanity with asterisk. The module currently uses the Google list of bad words as default. Adding/replacing the dictionary coming soon.
Installation
npm install --save simply-profanity-filter-with-whitelist
Usage
var profanityFilter = ; // simple filteringvar filtered_string = profanityFilter;console; // "Some bad words, *****!" // add some custom bad wordsprofanityFilter;var filtered_string = profanityFilter;console; // "Some ****** *** *****, *****!" // replace bad words list with new listprofanityFilter;var filtered_string = profanityFilter;console; // "Some ****** *** *****, bitch!" // add whitelistprofanityFilter;profanityFilter;var filtered_string = profanityFilter;console; // "Some ****** *** ***** and Notbadwords, bitch!" // has bad wordsprofanityFilter;profanityFilter;var has_bad_words = profanityFilter;console; // false