Real profanity words banned by Google, extracted from their hidden API before shutdown. Now available as an easy-to-use Node.js library for content filtering.
npm install @coffeeandfun/google-profanity-words> A fun and developer-friendly profanity detection library brought to you by Coffee & Fun LLC βπ
> Built and maintained with love by Robert James Gabriel π»β¨
 
---
Google Profanity Words is a Node.js library that helps you detect and filter out naughty language (in multiple languages!) from your apps or content. Whether youβre building a chat app, a comment section, or a gameβthis oneβs your profanity-slaying sidekick.
Made by devs for devs. Maintained by Robert at Coffee & Fun ββ€οΈ
---
- π Multilingual support β English and Spanish out of the box. More coming soon!
- π Monthly updates β Stay fresh with the latest no-no words
- π‘ Easy to use API β Straightforward methods, async/await friendly
- π¬ Tested with Jest β Fully covered and ready for production
- β‘ Tiny & Fast β Minimal deps = speedy installs and performance
---
``bash`
npm install @coffeeandfun/google-profanity-words
---
`javascript
import { ProfanityEngine } from '@coffeeandfun/google-profanity-words';
// Default is English
const profanity = new ProfanityEngine();
// EspaΓ±ol? You got it.
const profanityES = new ProfanityEngine({ language: 'es' });
// Check a single word
const isBad = await profanity.search('example');
// Or check a full sentence
const hasCurses = await profanity.hasCurseWords('This is a test sentence');
console.log(isBad, hasCurses); // true / false
`
---
Create a new profanity detector engine!
`javascript`
const profanity = new ProfanityEngine(); // Defaults to English
Or choose a specific language:
`javascript`
const spanishProfanity = new ProfanityEngine({ language: 'es' });
#### Options:
- language (string, optional): 'en'
- = English (default) 'es'
- = Spanish
- If a language isnβt available, it falls back to English.
---
Check a single word to see if it's naughty.
`javascript`
const isProfane = await profanity.search('heck');
console.log(isProfane); // true or false
---
Check a full sentence or phrase for profanity.
`javascript`
const result = await profanity.hasCurseWords('You silly goose');
console.log(result); // probably false, unless goose is banned now πͺΏ
---
Get the full list of bad words in the current language.
`javascript`
const badWords = await profanity.all();
console.log(badWords); // ['word1', 'word2', 'etc']
---
- Empty strings? We gotchu. Returns false.search()
- and hasCurseWords() are case-insensitive.
- Special characters and punctuation? No problem.
---
We've got testing covered like whipped cream on a latte βπ
Run the default test suite:
`bash`
npm test
Or use more specific Jest commands:
`bashWatch mode (great for dev workflow)
npx jest --watch
Tests are located in the
/__tests__/ directory and use the real profanity files, so you know itβs legit πβ
---
π Example Use Cases
$3
`js
async function filterInput(input) {
if (await profanity.hasCurseWords(input)) {
return 'β οΈ Whoa there! Language, please.';
}
return input;
}
`---
$3
`js
const en = new ProfanityEngine({ language: 'en' });
const es = new ProfanityEngine({ language: 'es' });const englishResult = await en.search('bad');
const spanishResult = await es.search('malo');
`---
π Want to Contribute?
We love open source buddies π
$3
1. Fork it π΄
2. Add a file to
/data/ named like fr.txt` for French---
Built by Robert James Gabriel and the good people at Coffee & Fun LLC. We make dev tools with accessibility, coffee, and good vibes in mind.
> Wanna support? Send a coffee our way or just spread the word! βπ
---
MIT β because sharing is caring.
---
- π Report Bugs
- π‘ Join Discussions
- π¬ Email: support@coffeeandfun.com
---
Made with β, code, and a sprinkle of magic at Coffee & Fun LLC π