1.0.7 ā€¢ Published 1 year ago

profanity-list v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

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

šŸ¤ 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