1.2.0 • Published 2 years ago

cosmic-profanity v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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"
 */
1.2.0

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.2

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago