Registry / serialization / bad-words-es

bad-words-es

JSON →
library1.0.0jsnpmunverified

A forked JavaScript filter for profanity detection and cleaning, supporting both Spanish ('es') and English words. Current version 1.0.0 is stable but not actively maintained (last release long ago). It extends the original badwords library with a bilingual word list, language selection, custom placeholder/regex options, and methods to add/remove words. Differentiators include bilingual support out of the box and a simple API, though it lacks TypeScript types and uses CommonJS only.

npm install bad-words-es
INSTALL
IMPORT
SIG · BAD-WORDS-ES
B
bad-words-es
serializationjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Filter
const Filter = require('bad-words-es')
import Filter from 'bad-words-es'
CommonJS only; no ESM support. Default export is a function/class.
Filter
const { default: Filter } = require('bad-words-es')
Not needed; just require the module.
type definitions
// No official types; use @types/bad-words-es or declare module
import Filter from 'bad-words-es' with type
No TypeScript support; you must create your own declaration file.

Shows how to create a filter with bilingual languages, clean profanity, add custom words, and change placeholder character.

const Filter = require('bad-words-es'); const filter = new Filter({ languages: ['es', 'en'] }); console.log(filter.clean("No seas pendej0")); // "No seas *******" console.log(filter.clean("Don't be an ash0le")); // "Don't be an ******" // Add custom words filter.addWords('custombad'); console.log(filter.clean("That is custombad")); // "That is *********" // Use placeholder const customFilter = new Filter({ placeHolder: 'x' }); customFilter.clean("Bad word here"); // "xxx xxxx xxxx"
Debug
Known issues
deprecatedPackage is not actively maintained; no updates since initial release.
fix
Consider using alternatives like 'profanity-filter' or 'msl-word-filter' for active support.
affects: >=1.0.0
gotchaOnly supports CommonJS; cannot be imported with ES module import syntax.
fix
Use require() instead of import. If using TypeScript, set esModuleInterop or use a dynamic import.
affects: >=1.0.0
gotchaNo TypeScript type definitions; type safety is not provided.
fix
Declare your own module types or use @ts-ignore.
affects: >=1.0.0
breakingLanguage selection via options.languages is an array, but default behavior may not work as expected if not specified.
fix
Always pass { languages: ['es', 'en'] } to ensure both languages are used.
affects: >=1.0.0
gotchaThe word list may contain false positives or miss certain profanity due to regional variations.
fix
Regularly update the blacklist using addWords/removeWords.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'bad-words-es'
Package not installed or typo in module name.
fix
Ensure 'npm install bad-words-es' runs and module name is correct.
Filter is not a constructor
Using import instead of require in CommonJS environment.
fix
Use 'const Filter = require('bad-words-es');'
TypeError: filter.clean is not a function
Incorrect instantiation or Filter class not imported properly.
fix
Verify Filter is imported correctly and instantiated: 'const filter = new Filter();'
Unexpected token 'export'
ES module syntax used in a CommonJS file without transpilation.
fix
Use require() syntax instead of import/export.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
bad-words-es — npm install bad-words-es · libregistry