Lightweight profanity filter with zero dependencies.
npm install bleeper
npm install @peterm45/bleeper
import { filter, contains, analyze } from 'bleeper';
filter('This is shit'); // → 'This is ****'
filter('What the f*ck'); // → 'What the ****'
filter('h3ll0 world'); // → '***** world'
contains('Bad f*ck'); // → true
analyze('Bad f*ck').found; // → ['fuck']
- Character substitution:
f*ck
,$h1t
,h3ll0
, etc. - Unicode support: Greek (
αss
), Cyrillic (а$$
), etc. - Word boundaries: Won't flag "Class" for containing "ass"
- Zero dependencies: Pure TypeScript
- Lightweight: ~8KB package size
Replaces profanity with asterisks.
filter('Hello shit');
// → 'Hello ****'
filter('Hello shit', { replacement: '[CENSORED]' });
// → 'Hello [CENSORED]'
filter('Hello shit', { customWords: ['hello'] });
// → '**** ****'
Returns true
if text contains profanity.
contains('Hello shit'); // → true
contains('Hello world'); // → false
Returns detailed analysis.
analyze('Hello shit');
// → {
// clean: 'Hello ****',
// hasProfanity: true,
// found: ['shit']
// }
To ensure version consistency across package.json
, CHANGELOG.md
, and git tags:
# Check version consistency
npm run check-version
# Bump version (updates all files + creates git tag)
npm run bump patch "Fix character substitution bug"
npm run bump minor "Add new feature"
npm run bump major "Breaking API change"
MIT