{"id":24976,"library":"badwords-ko","title":"badwords-ko","description":"A Korean profanity filter library for Node.js and browser, v1.0.4 (current stable). Provides a Filter class with customizable placeholder, regex, and blacklist management (add/remove words). Supports ES6+ import syntax. Built as a Korean adaptation of the bad-words npm package. Lightweight, no dependencies, TypeScript definitions not shipped. Slow release cadence (last update 2022). Differentiator: specifically targets Korean profanity with a built-in blacklist of Korean curse words, unlike generic profanity filters.","status":"maintenance","version":"1.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/yoonheyjung/badwords-ko","tags":["javascript","bad","word","words","curse","projanity","filter"],"install":[{"cmd":"npm install badwords-ko","lang":"bash","label":"npm"},{"cmd":"yarn add badwords-ko","lang":"bash","label":"yarn"},{"cmd":"pnpm add badwords-ko","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package uses ES module default export. CommonJS require without .default will fail. Use with transpiler/Babel.","wrong":"const Filter = require('badwords-ko')","symbol":"Filter","correct":"import Filter from 'badwords-ko'"},{"note":"Named export is not available; only default export exists. CommonJS destructuring will result in undefined.","wrong":"const { Filter } = require('badwords-ko');","symbol":"Filter (named import)","correct":"import { Filter } from 'badwords-ko'"},{"note":"Since version 1.0.0, the package is ESM-only. In CommonJS environments, you must use .default to access the constructor.","wrong":"const Filter = require('badwords-ko');","symbol":"require (CommonJS)","correct":"const Filter = require('badwords-ko').default"}],"quickstart":{"code":"import Filter from 'badwords-ko';\n\nconst filter = new Filter();\n\nconsole.log(filter.isProfane('시발')); // true\nconsole.log(filter.clean('욕을 합니다 개새끼')); // '욕을 합니다 ***'\n\nconst customFilter = new Filter({ placeHolder: 'x', list: ['나쁜'] });\ncustomFilter.addWords('무진장');\nconsole.log(customFilter.clean('무진장 나쁜 말!')); // 'xxxx xxx 말!'\n\nfilter.removeWords('시발');\nconsole.log(filter.clean('시발')); // '시발' (no longer filtered)","lang":"javascript","description":"Creates a Filter instance, checks for profanity, cleans text with default/regex/placeholder, adds and removes custom blacklist words."},"warnings":[{"fix":"Consider using 'bad-words-next' or build your own filter for better maintainability.","message":"Package uses deprecated 'bad-words' as reference; original package no longer maintained.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use 'replaceRegex' option to control replacement regex, not 'regex'.","message":"Constructor accepts 'regex' option but actually uses 'replaceRegex' for replacement; 'regex' is for sanitization before matching.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use filter.addWords(...list) instead of filter.addWords(list).","message":"Calling addWords/removeWords with a single array will treat array as one word; use spread operator.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use ES modules or set project to type: module. Alternatively, use dynamic import() in CommonJS.","message":"Package is ESM-only and does not export a CommonJS module; requires transpiler or Node.js >=16 with type: module.","severity":"breaking","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":"Use const Filter = require('badwords-ko').default;","cause":"Requiring the module directly returns the module exports, not the default export.","error":"const Filter = require('badwords-ko'); TypeError: Filter is not a constructor"},{"fix":"Add 'type': 'module' to package.json or use .mjs extension.","cause":"Using ES import syntax in a CommonJS environment without proper module configuration.","error":"import Filter from 'badwords-ko'; SyntaxError: Cannot use import statement outside a module"},{"fix":"Ensure you don't set emptyList: true unless you intend to add words later. Use new Filter() without options.","cause":"Possibly empty blacklist if (emptyList: true) or words not added.","error":"filter.clean('some string') returns same string even when profane words present"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}