1.0.1 • Published 5 years ago
sanitize-words v1.0.1
Sanitize Words
Remove undesirable words from input
Installation
npm install sanitize-wordsUsage example
sanitizeWords(input, [options: {
    replacement: "-------", // string used to replace unwanted words
    custom: []. // an array of custom words to add to filter
    customOnly: false // if true, only the custom words will be filtered
}]);Examples
const sanitizeWords = require("sanitize-words");
const words = "The quick brown fox jumped over the lazy dog.";
// Remove undesirable words using the included "badWords.txt" only
words = sanitizeWords(words);
// Remove undesirable words using both some custom input and the included bad words.
let custom = ["quick", "freaks"];
words = sanitizeWords(words, { custom });For more examples and usage, please refer to the Wiki.
Development setup
Describe how to install all development dependencies and how to run an automated test-suite of some kind. Potentially do this for multiple platforms.
npm installRelease History
- 1.0.0 initial release
Meta
Rane Wallin – @rane_wallin
Distributed under the MIT license. See LICENSE for more information.
Contributing
- Fork it (https://github.com/RaneWallin/sanitize-words.git/fork)
- Create your feature branch (git checkout -b feature/fooBar)
- Commit your changes (git commit -am 'Add some fooBar')
- Push to the branch (git push origin feature/fooBar)
- Create a new Pull Request