automod-filter
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

automod-filter

A javascript filter for badwords

Build Status

Installation

npm install automod-filter --save

Usage

const { Automod } = require('automod-filter');

console.log(Automod.filter("What the fuck is going on here? Whore", { langs: [ Lang.ENGLISH ] })) // What the ████ is going on here? █████

Options

const { Automod, Lang, Method } = require('./lib/index.js');

console.log(Automod.filter("d@mn а я fuck не понял 6ля что вы shit делаете whore в холодильнике cуk@", { langs: [ Lang.ENGLISH ], method: Method.CLASSIC } ));
// {
//     input: 'd@mn а я fuck не понял 6ля что вы shit делаете whore в холодильнике cуk@',      
//     output: 'd@mn а я ████ не понял 6ля что вы ████ делаете █████ в холодильнике cуk@'
//     matches: [ 'fuck', 'Whore' ]
// }

console.log(Automod.filter("d@mn а я fuck не понял 6ля что вы shit делаете whore в холодильнике cуk@", { langs: [ Lang.ENGLISH, Lang.RUSSIAN ], method: Method.STRICT, replacer: "*" }));
// {
//     input: 'd@mn а я fuck не понял 6ля что вы shit делаете whore в холодильнике cуk@',      
//     output: '**** я **** не понял *** что вы **** делаете ***** в холодильнике ****',     
//     matches: [ 'd@mn', 'fuck', '6ля', 'shit', 'whore', 'cуk@' ]
// }

TODO

  • Regex search
  • Fill English replacers
  • URL parser

Community

Package Sidebar

Install

npm i automod-filter

Weekly Downloads

4

Version

1.0.1

License

ISC

Unpacked Size

68.6 kB

Total Files

16

Last publish

Collaborators

  • idaspin