@zhangfuxing/keyword-filter
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

keyword-filter

Sensitive word filter

Node.js 12+ required (Because of use Class private fields)

Install

$ npm i @zhangfuxing/keyword-filter

Useage

const assert = require('assert');
const WordFilter = require('@zhangfuxing/keyword-filter');
const dir = './keywords';
const text = '测试-兼职';
const wordFilter = new WordFilter(dir);
const result = '测试-**';
assert(result === wordFilter.filter(text));

Test

$ npm test

Package Sidebar

Install

npm i @zhangfuxing/keyword-filter

Weekly Downloads

42

Version

1.0.6

License

MIT

Unpacked Size

17.7 kB

Total Files

9

Last publish

Collaborators

  • fuxingzhang