Socket
Socket
Sign inDemoInstall

sensitive-words-dfa-filter

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sensitive-words-dfa-filter

The word filter via dfa.


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

sensitive-words-filter

NPM Version NPM Downloads Build Linux Build Windows Build Test Coverage

文字过滤,支持敏感词匹配,由DFA算法实现

Install

npm install sensitive-words-dfa-filter --save

How to use

let Filter = require('sensitive-words-dfa-filter');

// 设定需要搜索的敏感字
let search = [
  'f',
  'filter'
];

// 初始化文字过滤器,将敏感字做成字典
Filter.instance().init(search);

// 运行
console.log(Filter.instance().replace('This is filter word!')); // This is ****** word!
console.log(Filter.instance().replace('This is fffffilterfffff word!')); // This is *************** word!

FAQs

Last updated on 15 Nov 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc