{"id":24974,"library":"bad-words-es","title":"bad-words-es","description":"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.","status":"maintenance","version":"1.0.0","language":"javascript","source_language":"en","source_url":"git://github.com/MoisesLaris/badwords-es","tags":["javascript","curse","words","groserias","malas palabras","profanity","spanish","es","filter"],"install":[{"cmd":"npm install bad-words-es","lang":"bash","label":"npm"},{"cmd":"yarn add bad-words-es","lang":"bash","label":"yarn"},{"cmd":"pnpm add bad-words-es","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CommonJS only; no ESM support. Default export is a function/class.","wrong":"import Filter from 'bad-words-es'","symbol":"Filter","correct":"const Filter = require('bad-words-es')"},{"note":"Not needed; just require the module.","wrong":"","symbol":"Filter","correct":"const { default: Filter } = require('bad-words-es')"},{"note":"No TypeScript support; you must create your own declaration file.","wrong":"import Filter from 'bad-words-es' with type","symbol":"type definitions","correct":"// No official types; use @types/bad-words-es or declare module"}],"quickstart":{"code":"const Filter = require('bad-words-es');\nconst filter = new Filter({ languages: ['es', 'en'] });\nconsole.log(filter.clean(\"No seas pendej0\")); // \"No seas *******\"\nconsole.log(filter.clean(\"Don't be an ash0le\")); // \"Don't be an ******\"\n\n// Add custom words\nfilter.addWords('custombad');\nconsole.log(filter.clean(\"That is custombad\")); // \"That is *********\"\n\n// Use placeholder\nconst customFilter = new Filter({ placeHolder: 'x' });\ncustomFilter.clean(\"Bad word here\"); // \"xxx xxxx xxxx\"","lang":"javascript","description":"Shows how to create a filter with bilingual languages, clean profanity, add custom words, and change placeholder character."},"warnings":[{"fix":"Consider using alternatives like 'profanity-filter' or 'msl-word-filter' for active support.","message":"Package is not actively maintained; no updates since initial release.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use require() instead of import. If using TypeScript, set esModuleInterop or use a dynamic import.","message":"Only supports CommonJS; cannot be imported with ES module import syntax.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Declare your own module types or use @ts-ignore.","message":"No TypeScript type definitions; type safety is not provided.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always pass { languages: ['es', 'en'] } to ensure both languages are used.","message":"Language selection via options.languages is an array, but default behavior may not work as expected if not specified.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Regularly update the blacklist using addWords/removeWords.","message":"The word list may contain false positives or miss certain profanity due to regional variations.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure 'npm install bad-words-es' runs and module name is correct.","cause":"Package not installed or typo in module name.","error":"Cannot find module 'bad-words-es'"},{"fix":"Use 'const Filter = require('bad-words-es');'","cause":"Using import instead of require in CommonJS environment.","error":"Filter is not a constructor"},{"fix":"Verify Filter is imported correctly and instantiated: 'const filter = new Filter();'","cause":"Incorrect instantiation or Filter class not imported properly.","error":"TypeError: filter.clean is not a function"},{"fix":"Use require() syntax instead of import/export.","cause":"ES module syntax used in a CommonJS file without transpilation.","error":"Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}