Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
All in One Profanity and Spam Tool, supporting multiple languages and modes.
Atm works only if you have babel on client, compile coming soon.
Tool | Use | Default Status |
---|---|---|
Profanity | Used to censor words using the selected modes. | Enabled |
Spam | Uses an algorithm to stop repeating characters. | Disabled |
Warning : Examples may contain offensive text
import profam from 'profam';
//Initialize
let profam = new profam();
//(server) Changing localesDir will update locales with the contents of the dir
profam.profanity.setLocalesDir('/locales/');
//OR
//(client) Assuming you are hosting languages on your own, you will need to specify a get-url mockup.
profam.profanity.setLocalesDir('/locales/[locale].json');
//Now that you have a get-url mockup you can start adding languages, and profam will take care of the rest.
profam.profanity.setLocales('en');
//Now english is added, bad-words in english will be replaced with the default mode's text. To change it:
profam.profanity.setModes('funny');
//Bad-words will be replaced with funny words using funny mode.
profam.process('Go to hell!'); // returns-> Go to unicorn!.
// ---> Done! Now bad-words in english will be censored! Lets say you want to add a custom language:
profam.profanity.setLocales('customLanguage', true); // -> 2nd param: marks it as custom
//OR
profam.profanity.setLocales('customLanguage', true, true); // -> 3rd param: simply *adds* a new language, instead of replacing english.
//Adding words to your custom language:
profam.profanity.addWords('customLanguage', ['badword']);
Method | Parameters | Use | Default |
---|---|---|---|
profanity.enable = | Boolean | Enable or disable profanity | TRUE |
profanity.setLocalesDir(<string>) | String | Replaces [locale] with the language you want to download. Ex: example.com/locales/[locale].js | null |
profanity.setLocales(<string/array>, <true/false>, <true/false> |
| Add the languages you wonna look for bad-words |
|
profanity.addWords(<string>, <array>, <boolean>) |
| Add new words in selected locale. | |
profanity.removeWords(<string>, <array>) |
| Remove words from locale. | |
profanity.setModes(<string/array>) |
| Set Modes | asterisks-obscure |
profanity.getLocales() | Get Locales | ||
profanity.getLocalesEnabled() | Get Locales Enabled | ||
profanity.getModes() | Get Modes | ||
profanity.getModesEnabled() | Get Modes Enabled |
Method | Parameters | Use | Default |
---|---|---|---|
spam.enable | Boolean | Enable or disable Spam | FALSE |
Method | Parameters | Use | Default |
---|---|---|---|
.proceed(<string>) | String | Return censored string |
FAQs
Profanity and Spam Tool, supporting multiple languages and modes.
The npm package profam receives a total of 23 weekly downloads. As such, profam popularity was classified as not popular.
We found that profam 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.