https://github.com/d-oliveros/profanity-censor
Profanity filter for NodeJS
https://github.com/d-oliveros/profanity-censor
Last synced: about 2 months ago
JSON representation
Profanity filter for NodeJS
- Host: GitHub
- URL: https://github.com/d-oliveros/profanity-censor
- Owner: d-oliveros
- License: mit
- Created: 2015-06-16T21:56:11.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-04-05T05:34:51.000Z (about 8 years ago)
- Last Synced: 2025-03-19T06:04:38.762Z (2 months ago)
- Language: JavaScript
- Size: 15.6 KB
- Stars: 12
- Watchers: 1
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# profanity-censor
A tiny node.js module for censoring curse and bad words. It hosts a default dictionary,
with the option to use your own.## Installation
```
npm install --save profanity-censor
```## API
### profanity.filter(string)
Replaces the bad words in the string with asterisks. Returns the censored string.
```javascript
var profanity = require('profanity-censor');console.log(profanity.filter('Bad words here.'));
```### profanity.use(dictionary)
Replaces the dictionary with a provided dictionary. The dictionary should be an
array of strings.```javascript
var profanity = require('profanity-censor');
var dictionary = ['popcorn', 'bad words'];
profanity.use(dictionary);
```