JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q44070F
  • License MIT

clean profanity from strings

Package Exports

  • cosmic-profanity
  • cosmic-profanity/build/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cosmic-profanity) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cosmic-profanity

A JavaScript profanity filter (with TypeScript support)

Getting Started

Install package

npm i cosmic-profanity

Usage

import Filter from 'cosmic-profanity'
// or
var Filter = require('cosmic-profanity').default


Filter.isProfane('I like big butts and I cannot lie')
// true

Filter.isProfane('I like big glutes and I cannot lie')
// false

Filter.clean('I like big butts (aka arses) and I cannot lie')
// I like big * (aka *) and I cannot lie

Options

wholeWord

determins if cleaning a string should remove the whole word or just some of it.

import Filter from 'cosmic-profanity'

Filter.wholeWord = true

Filter.clean('motherfucker')

/**
 * with wholeWord turned on "****"
 * 
 * with it turned off "mother****er"
 */