cuss-word-filter-ko
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

Welcome to cuss-word-filter-ko 👋

한국어 욕설을 바꿔주는 간단한 모듈

🏠 Homepage

😃 Npm

Installation

npm i cuss-word-filter-ko

Options

type CussWordFilterOptions = {
    /**
     * @default "./cuss-word-list.json" 에 있는 단어들
     * @description 필터링할 단어들
     */
    cussWords?: string[];

    /**
     * @default '*'
     * @example '****'
     */
    replacement?: string;

    /**
     * @default false
     * @description default cussWords 와 constructor option 에서 전달된 cussWords 를 합칠지 여부
     */
    mergeDefaultData?: boolean;

    /**
     * @default []
     * @description 필터링을 제외할 단어들, isCussWord, filter method 에서 적용됨
     */
    whiteList?: string[];
}

Usage

const { CussWordFilter } = require("cuss-word-filter-ko");

const filter = new CussWordFilter({});

console.log(filter.filter("ㅅㅂ 놈아")); // ** 놈아

or

import { CussWordFilter } from "cuss-word-filter-ko";

const filter = new CussWordFilter({});
console.log(filter.filter("ㅅㅂ 놈아")); // ** 놈아

Test Coverage

image

Contributing

Contributions, issues and feature requests are welcome!

License

MIT


Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i cuss-word-filter-ko

    Weekly Downloads

    3

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    91.6 kB

    Total Files

    20

    Last publish

    Collaborators

    • kwonkunkun