text-censor
text-censor copied to clipboard
Simple nodejs text censor for GWF. Nodejs 敏感词过滤器。
``` var tc = require('./index.js'); setTimeout(function () { tc.filter('Ur so sexy babe! 摸你鸡巴', function (err, censored) { console.error("result", censored,); }); }, 20000) ``` -------- result Ur so ***y babe! **鸡巴
es6,更健壮的异步方式,优化敏感词替换过程,优先替换长字符串
关于执行
------------------------------------------------------ 已经解决了.原来log会有问题,实际已经替换了... var tc = require('text-censor') tc.filter('Ur so sexy babe!',function(err, censored){ console.log(censored) // 'Ur so ***y babe!' }) node执行结果'Ur so sexy babe!' mocha 执行结果 'Ur so ***y babe!' npm -v...
Cannot find module 'text-censor' ??