https://github.com/skidgod4444/profanity-validator
A lightweight SDK for profanity filtering in forms. This library is designed to prevent bad word spam by validating user input and throwing errors if profanity is detected.
https://github.com/skidgod4444/profanity-validator
profanity profanity-detection profanity-validator swearword
Last synced: 25 days ago
JSON representation
A lightweight SDK for profanity filtering in forms. This library is designed to prevent bad word spam by validating user input and throwing errors if profanity is detected.
- Host: GitHub
- URL: https://github.com/skidgod4444/profanity-validator
- Owner: SkidGod4444
- License: mit
- Created: 2024-10-27T04:58:25.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-03-21T17:40:10.000Z (2 months ago)
- Last Synced: 2025-04-24T19:03:58.155Z (27 days ago)
- Topics: profanity, profanity-detection, profanity-validator, swearword
- Language: TypeScript
- Homepage: https://profanity.devwtf.in/
- Size: 2.35 MB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# profanity-validator
[](https://www.youtube.com/watch?v=WVCBLilL0mQ)
A lightweight SDK for profanity filtering in forms. This library is designed to prevent bad word spam by validating user input and throwing errors if profanity is detected. Built to be flexible, it can be integrated easily into any HTML or JavaScript framework, including React, Next.js, and many more.
## Features
- **Profanity Filtering:** Automatically detects and validates user input against a predefined list of profane words.
- **Customizable:** Allows users to add their own custom profanity words to the validation.
- **Framework Agnostic:** Works seamlessly across different frameworks and libraries.
- **Error Handling:** Throws validation errors instead of replacing profanity words, preventing form submission.
- **Asynchronous Validation:** Uses an internal API [(profanity.dev)](https://www.profanity.dev/) to check for profanity, Built by [Josh](https://github.com/joschan21) .## Installation
You can install the SDK via any nodejs package manager:
```bash
npm install profanity-validator@latest
``````bash
pnpm add profanity-validator@latest
``````bash
bun add profanity-validator@latest
``````bash
yarn add profanity-validator@latest
```## Examples
We have mentioned few examples with preview and source code:
- **Example 1:** [ Basic Profanity Validation](https://profanity.devwtf.in/examples#basic-example) | [Source](https://github.com/SkidGod4444/profanity-validator/blob/main/www/components/custom/examples/example1.tsx)
- **Example 2:** [Profanity Validation with React Hook Form](https://profanity.devwtf.in/examples/#react-hook-form-example) | [Source](https://github.com/SkidGod4444/profanity-validator/blob/main/www/components/custom/examples/example2.tsx)
- **Example 3:** [Integrating with Zod schema validation](https://profanity.devwtf.in/examples/#zod-schema-example) | [Source](https://github.com/SkidGod4444/profanity-validator/blob/main/www/components/custom/examples/example3.tsx)
- **Example 4:** [Multiple fields and real-time validation](https://profanity.devwtf.in/examples/#real-time-validation-example) | [Source](https://github.com/SkidGod4444/profanity-validator/blob/main/www/components/custom/examples/example4.tsx)## Change Logs
- **Change Logs:** View the [Change Log](https://github.com/SkidGod4444/profanity-validator/blob/main/CHANGELOG.md) for a detailed history of changes and updates.
## Contributing
We welcome contributions! Please feel free to submit a pull request or open an issue if you have suggestions or improvements.
## License
This project is licensed under the MIT License. See the [LICENSE](https://github.com/SkidGod4444/profanity-validator?tab=MIT-1-ov-file) file for details.
## Contact
For support or inquiries, please reach out to [[email protected]](https://dub.sh/saidev-twitter) or join our [discord community!](https://l.devwtf.in/discord)