Efficient profanity filter for JavaScript/TypeScript applications with flexible configuration and simple API π‘οΈ
pure-flow-ai
is a powerful and flexible profanity filter for JavaScript and TypeScript applications. It provides a simple yet comprehensive API for detecting, masking, and cleaning text from inappropriate language. Perfect for chat applications, comment systems, or any text-processing functionality requiring content moderation.
- π Smart Detection: Efficiently identifies profane words in text
- π Flexible Masking: Customizable placeholder characters for censoring
- π§Ή Text Cleaning: Complete removal of inappropriate content
- π Customizable Lists: Add your own words to block or allow
- πͺ TypeScript Support: Full type definitions included
- π Case Insensitive: Works regardless of letter casing
- π― Zero Dependencies: Lightweight and efficient
- π Unicode Support: Works with special characters and different alphabets
npm install pure-flow-ai
yarn install pure-flow-ai
pnpm install pure-flow-ai
import BadWordFilter from 'pure-flow-ai';
// Initialize with default options.
const { hasProfaneWords, maskProfanity, cleanString } = BadWordFilter({
additionalBlockWords: ['bad', 'word,'],
excludedWords: ['trash'],
placeholder: '*',
overrideBlockWords: true
});
// Check if text contains profanity.
const hasBadWords = hasProfaneWords('your text here');
// Mask profane words with asterisks
const masked = maskProfanity('your text here');
// Clean text by removing profane words.
const clean = cleanString('your text here');
We'd love for you to contribute to pure-flow-ai
! Whether it's reporting bugs, suggesting features, or submitting pull requests, your help is always appreciated.
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature
). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature/your-feature
). - Open a pull request.
Please follow our Code of Conduct when participating in this project to ensure a welcoming and productive atmosphere.
Security is our priority. If you encounter any issues, please read our full Security Policy to report vulnerabilities safely and responsibly.
These folks keep the project moving and are resources for help.
Artemev A. A. |
This project is licensed under the MIT License - see the LICENSE file for details.
π‘οΈ Make your application safer with pure-flow-ai!
If you found this project useful, please consider giving it a βοΈ on Github and sharing it with your friends!