profanity-list
v1.0.7
Published
Identify, remove, replace, and count profanities within a string or an array of strings.
Downloads
46
Maintainers
Readme
Identify, remove, replace, and count profanities within a string or an array of strings.
Install
npm install profanity-list
Usage
hasSwearWord
import profanity from 'profanity-list';
profanity.hasSwearWord("this fucking sucks."); //true
profanity.hasSwearWord("Today has been great!"); //false
profanity.hasSwearWord(["Today has been great!", "I hate this shit"]); //false
profanity.hasSwearWord(["Today has been great!", "I'm so happy"]); //true
numberOfSwears
import profanity from 'profanity-list';
profanity.numberOfSwears("this shit fucking sucks."); //2
profanity.numberOfSwears("Today has been great!"); //0
profanity.numberOfSwears(["Today has been great!", "I hate this shit"]); //[0, 1]
profanity.numberOfSwears(["What the fuck!", "This shit fucking sucks."]); //[1, 2]
removeSwears
import profanity from 'profanity-list';
profanity.removeSwears("this shit fucking sucks."); //this shit ******* sucks.
profanity.removeSwears("Today has been great!"); //Today has been great!
profanity.removeSwears(["Today has been great!", "I hate this shit"]); //["Today has been great!", "I hate this ****"]
profanity.removeSwears(["What the fuck!", "This shit fucking sucks."]); //["What the ****!", "This **** ******* sucks."]
Author
👤 Kohl Byrd
- Website: kohlbyrd.com
- Twitter: @byrd_kohl
- Github: @Limeslices
🤝 Contributing
Contributions, issues and feature requests are welcome!Feel free to check issues page.
Show your support
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator