npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bad-words-chinese

v1.0.2

Published

A dirty word filter module supports Chinese and English

Downloads

286

Readme

bad-words-chinese

A dirty word filter module supports Chinese and English 這個模組可以偵測與過濾中、英文髒話。

Installation 安裝方式

npm install bad-words-chinese

Usage 使用方法

var Filter = require('bad-words-chinese'),
  filter = new Filter();

console.log(filter.clean("I'm CEO, Bitch")); //I'm CEO, *****
console.log(filter.clean("我是執行長,婊子")); //我是執行長,**
console.log(filter.isProfane("I'm CEO")); // false
console.log(filter.isProfane("我是執行長,婊子"));   // true

Placeholder Overrides 變更符號

var Filter = require('bad-words');
var customFilter = new Filter(
  { 
    placeHolder: 'x'
  }
);

customFilter.clean('I'm CEO, Bitch'); //I'm CEO, xxxxx

Add words to the blacklist 加入髒話關鍵字

var filter = new Filter(
  { 
    englishList: ['big', 'fat', 'pig'], 
    chineseList: ['大', '胖', '豬'] 
  }
); 

console.log(filter.clean("You are a big fat pig")); //You are a *** *** ***
console.log(filter.clean("你這隻大胖豬")); //你這隻***

Testing 測試方法

npm test

##Release Notes 更新紀錄

  • v1.0.0 / Feb 1 2016: First release
  • v1.0.2 / Dec 13 2016: Add credit to web-mech

Credit

This is a derived work from the npm package bad-words by web-mech. The orginal work is located at: https://github.com/web-mech/badwords

License 授權

The MIT License (MIT)

Copyright (c) 2016 Peiyu Chen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.