Ribald is a lightweight and efficient Node.js package designed for detecting vulgar and obscene words within strings. It returns an array containing these offensive terms found in the input string. With its comprehensive list of offensive terms, Ribald em
npm install ribaldjavascript :`
`import ribald from "ribald";`
`let input = "This is a test string containing vulgar words like fuck, asshole, and slut.";`
`let detectedWords = ribald(input);`
`console.log(detectedWords);`
This will output an array containing all detected vulgar words from the input string.
Example
`import ribald from "ribald";`
`let input = "This is a test string containing vulgar words like fuck, asshole, and slut.";`
`let detectedWords = ribald(input);`
`console.log(detectedWords);`
`
// Output:
{
"original": "This is a test string containing vulgar words like fuck, asshole, and slut.",
"words": ["fuck", "asshole", "slut"],
"count": 3,
"filter": "This is a test string containing vulgar words like *, , and **."
}
``