
Security News
The Code You Didn't Write Is Still Yours to Defend
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.
@therohitdas/profanityjs
Advanced tools
Simple profanity filter and masker.
npm install @therohitdas/profanityjs
ProfanityJs comes with two functions:
containsProfanity(sentence, useHomoglyphSearch): This function takes two required arguments.
sentence can be a word/ sentence/ paragraph which you want to check.useHomoglyphSearch should be set true for now. In the future, I will add a method to checkProfanity without using glyph and better search time.It returns true if the sentence contains at least one naughty word, false otherwise.
const { containsProfanity } = require("@therohitdas/profanityjs");
var testSentence = "Go fuck yourself!";
if (containsProfanity(testSentence, true)) {
console.log("Naughty word(s) detected");
} else {
console.log("Clean :)");
}
// Output -
// Naughty word(s) detected
maskProfanity(sentence, mask):
This function takes two arguments.
sentence can be a word/ sentence/ paragraph from which you want to check and mask the naughty word(s).mask is the character with which you want to mask the naughty word. Default is "*".It returns the sentence with all the naughty words masked with the mask character. If there are no naughty words, it returns the input sentence unchanged.
const { maskProfanity } = require("@therohitdas/profanityjs");
var testSentence = "Go fuck yourself!";
var maskedSentence = maskProfanity(testSentence);
console.log(maskedSentence); // Output - Go **** yourself!
maskedSentence = maskProfanity(testSentence, "#");
console.log(maskedSentence); // Output - Go #### yourself!
All contributions are welcome to improve this project.
FAQs
Simple profanity filter and masker.
We found that @therohitdas/profanityjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.