@vnphu/vn-badwords
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Vietnamese Bad Words

This package is for developers to be able to easily integrate bad word checking into their projects. This package can return bad words in array or regular expression (regex) form.

Enjoy!

Install

# NPM
npm install vn-badwords

# YARN
yarn add vn-badwords

# PNPM
pnpm i vn-badwords

Import

CommonJS (Node)

const { badWords, blackList } = require('vn-badwords');

ES6

import { badWords, blackList } from 'vn-badwords';

Usage

const text = "Có làm thì mới có ăn, không làm mà đòi có ăn thì ăn con cặc.";

badWords(text, { validate: true });
// output: true

badWords(text, { replacement: '*' });
// output: Có làm thì mới có ăn, không làm mà đòi có ăn thì ăn con ***.

badWords(text, '*');
// output similar to BadWords(text, { replacement: '*' });

badWords(text, '*', (badwordsMatch, count) => console.log(badwordsMatch, count));
// returns value and run the callback function

badWords(text, { replacement: '*', blackList: (defaultList) => [...defaultList, 'có', 'làm'] });
// custom sensitive words. Output: ** *** thì mới ** ăn, không *** mà đòi ** ăn thì ăn con ***.

=======

Tham gia server hỗ trợ để góp ý cũng như là đóng góp từ khóa nhé: https://discord.gg/pUhzvB4hcs

Package Sidebar

Install

npm i @vnphu/vn-badwords

Weekly Downloads

8

Version

1.1.1

License

MIT

Unpacked Size

56.5 kB

Total Files

9

Last publish

Collaborators

  • vnphu