Adding google-profanity-words to web page

72 Views Asked by At

I am trying to add https://github.com/coffee-and-fun/google-profanity-words to my website, but the only option I see is using Node.js which is not option for me since I need to install it on server and using from there(correct me if I am wrong)

I found some cdn like this one - https://www.skypack.dev/view/@coffeeandfun/google-profanity-words But didn't manage to get it to work.

I tried it like this -

import { ProfanityEngine } from '@coffeeandfun/google-profanity-words';

let profanity = new ProfanityEngine();

profanity.all(); // returns all bad words as an array.

profanity.search('bad word'); // returns true if the word is found in the list.

But getting an error that ProfanityEngine is not defined.

Can you please provide an example that this works on web page?

0

There are 0 best solutions below