Map of profanities, slurs, and obscenities to a sureness rating.
- What is this?
- When should I use this?
- Install
- Use
- API
- Data
- Types
- Compatibility
- Related
- Contributing
- Security
- License
This package exposes lists of profane words in several languages. This rating does not represent how vulgar a term is. It represents how likely it is to be used as either profanity or clean text.
Use this for researching natural language. Donβt use it to make a βprofanity filterβ. Those are bad.
This package is ESM only. In Node.js (version 14.14+, 16.0+), install with npm:
npm install cussIn Deno with esm.sh:
import {cuss} from 'https://esm.sh/cuss@2'In browsers with esm.sh:
<script type="module">
import {cuss} from 'https://esm.sh/cuss@2?bundle'
</script>import {cuss} from 'cuss'
import {cuss as cussPt} from 'cuss/pt'
console.log(Object.keys(cuss).length) // 1776
console.log(Object.keys(cussPt).length) // 173
console.log(cuss.beaver) // 0
console.log(cuss.asshat) // 2
console.log(cussPt.burro) // 1
console.log(cussPt.bixa) // 2cuss exports the following entries:
cussβ Englishcuss/ar-latnβ Arabic (Latin)cuss/esβ Spanishcuss/frβ Frenchcuss/itβ Italiancuss/ptβ Portuguesecuss/pt-ptβ European Portuguese
Each entry exports the identifier cuss.
There are no default exports.
Map of offensive words to a sureness rating (Record<string, number>).
Each rating is a number between 0 and 2 (both including), representing the
certainty the key is used as a profanity depending on context.
| Rating | Use as a profanity | Use in clean text | Example |
|---|---|---|---|
| 2 | likely | unlikely | asshat |
| 1 | maybe | maybe | addict |
| 0 | unlikely | likely | beaver |
cussβ Β± 1770 English profane words and phrases from Luis von Ahnβs Research Group (Carnegie Mellon), theList of ethnic slursfrom WikiPedia, and many contributions since)cuss/ar-latnβ Β± 250 Arabic (Latin) profane words and phrases fromnaughty-wordsandyouswearcuss/esβ Β± 650 Spanish profane words and phrases fromnaughty-words,revistagq.com,taringa.net,mundoxat.omcuss/frβ Β± 740 French profane words and phrases fromwiktionary.orgcuss/itβ Β± 800 Italian profane words and phrases from Italian profanity (WikiPedia); Italian slang Italian offensive terms Italian dialectal terms Italian jocular terms (Wiktionary); Parole oscene (Treccani); andchucknorris-io/swear-wordscuss/ptβ Β± 148 Portuguese profane words fromaprenderpalavras.comcuss/pt-ptβ Β± 45 Portuguese (European) profane words fromwikipediaand common culture
This package is fully typed with TypeScript. It exports no additional types.
This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. It also works in Deno and modern browsers.
buzzwordsβ list of buzzwordsdale-challβ list of familiar American-English words (1995)fillersβ list of filler wordshedgesβ list of hedge wordsprofanitiesβ list of the same profane words, but without the surenessspacheβ list of simple American-English words (1974)weaselsβ list of weasel words
Yes please! See How to Contribute to Open Source.
New terms can be added to the corresponding files as listed in the support section.
To add a new language, create a new JS file with a BCP 47 language tag as its name (lower case, dashes, and preferred and normalized).
After changing something, run npm install to install all required
dependencies, then npm test to update: the project includes some scripts to
make sure everything is in order.
Note that the tests require Node.js 18.0+.
Finally, open a pull request.
This package is safe.
MIT Β© Titus Wormer