1.1.3 • Published 4 years ago

proper-wordcheck v1.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

npm minified size Snyk Vulnerabilities for npm package GitHub issues GitHub last commit npm Eating Cake

Proper-Wordcheck

So you can stop using indexOf() and actually detect people trying to sneak through.

Usage

To install, run

npm install proper-wordcheck

Basic usage example:

//require the package
const wordcheck = require('proper-wordcheck');

//Add words to the list
wordcheck.addBadWord('pineapple');

//check if a message has it
if(wordcheck.checkForWord('Who even puts pineapple on pizza?'))
  return console.log("bad word detected!");
else
  return console.log("message clear chief.");

Full list of commands

addBadWord(word);

Add a bad word to the badWord list. (string) Returns: nothing.

addBadWords(words);

Add multiple bad words to the badWord list. (array) Returns: nothing.

removeBadWord(word);

Remove bad word from the badWord list. (string) Returns: nothing.

checkForWord(content);

Check a string (content) for containing any of the bad words. Returns: true on match, false otherwise.

allowUnicode(state);

Allow or disallow unicode. Makes the checks a bit worse but avoids false positives (See Issue #1) Returns: nothing.

addToWhitelist(word);

Add a word to white-list, so it will be skipped. Ex. badword = apple, whitelist = applepie, checkForWord("applepies are great") will return false.

Issues

All issues or pull requests are welcome. These checks won't be perfect, but I'm trying to make them as good as possible.

Licensing

This repo uses the MIT license.

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago