sensitive-escape
v1.0.3
Published
网站常见敏感词过滤
Downloads
6
Readme
#sensitive-escape
##网站常见敏感词过滤
Usage
//引入
var esc = require("sensitive-escape");
//定义敏感词库
var sensitiveWords = ["共产党", "习近平"];
//初始化过滤器
esc.init(sensitiveWords);
var msg = "我和习近平喝酒拜把子";
//过滤出的词
console.log(esc.find(msg)); //“习近平”
//执行过滤
concole.log(esc.santize(msg)); // 输出:我和*喝酒拜把子
About
此中间件是基于别人的成果(chn-escape)做练习的结果