Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

profam

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

profam

Profanity and Spam Tool, supporting multiple languages and modes.

  • 1.0.95
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-52.94%
Maintainers
1
Weekly downloads
 
Created
Source

Profam

All in One Profanity and Spam Tool, supporting multiple languages and modes.

Atm works only if you have babel on client, compile coming soon.

Thanks to:

  • Shutterstock Project, for provading all the bad words!

Tools Available

ToolUseDefault Status
ProfanityUsed to censor words using the selected modes.Enabled
SpamUses an algorithm to stop repeating characters.Disabled

How to

Warning : Examples may contain offensive text

Quick Start

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']);

In-Depth all methods

Profanity Tool

MethodParametersUseDefault
profanity.enable =BooleanEnable or disable profanityTRUE
profanity.setLocalesDir(<string>)StringReplaces [locale] with the language you want to download. Ex: example.com/locales/[locale].jsnull
profanity.setLocales(<string/array>, <true/false>, <true/false>
  1. Locales(s)
  2. is custom
  3. keep existing
Add the languages you wonna look for bad-words
  1. Empty
  2. false
  3. false
profanity.addWords(<string>, <array>, <boolean>)
  1. Locale
  1. Words
  1. Add
Add new words in selected locale.
profanity.removeWords(<string>, <array>)
  1. Locale
  1. Words
Remove words from locale.
profanity.setModes(<string/array>)
  1. Mode(s)
Set Modesasterisks-obscure
profanity.getLocales()Get Locales
profanity.getLocalesEnabled()Get Locales Enabled
profanity.getModes()Get Modes
profanity.getModesEnabled()Get Modes Enabled

Spam Tool

MethodParametersUseDefault
spam.enableBooleanEnable or disable SpamFALSE

Profam

MethodParametersUseDefault
.proceed(<string>)StringReturn censored string

Keywords

FAQs

Package last updated on 14 Apr 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc