bad words filter javascript code example
Example: How to Make a Bad Word Filter in JavaScript
const Filter = require("bad-words");
const filter = new Filter();
const words = require("./extra-words.json");
filter.addWords(...words);
console.log(filter.clean("Don't be an ash0le"));
console.log(filter.clean("You fucking mother fucker"));
console.log(filter.clean("You are a son of a whore"));
console.log(filter.clean("You fucking fucknut"));
console.log(filter.clean("fucking cunt"));
console.log(filter.clean("You are a shit ass"));
console.log(filter.clean("This fucking product is unbelievable"));
console.log(filter.clean("You are a bitch"));