profanity-list
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

Welcome to profanity-list 👋

Version License: ISC Twitter: byrd\_kohl

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

Package Sidebar

Install

npm i profanity-list

Weekly Downloads

5

Version

1.0.7

License

ISC

Unpacked Size

25 MB

Total Files

22

Last publish

Collaborators

  • kohlbyrd