@dragon-fish/words-filter

1.0.0 • Public • Published

Words Filter

Install

yarn add @dragon-fish/words-filter

Quick try

yarn test This is bad words.

Usage

const Filter = require('./index')
var filter = Filter({
  list: [
    'bad\\s*words?',
    // Bad words list with RegExp
  ],
  cleanWith: '*', // Replace bad words with
})

var goodWorlds = 'This is good words.'
var badWords = 'This is bad words.'

console.log(filter.isBad(goodWorlds), filter.isBad(badWords)) // false, true
console.log(filter.clean(badWords)) // This is *********.

/@dragon-fish/words-filter/

    Package Sidebar

    Install

    npm i @dragon-fish/words-filter

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    2.7 kB

    Total Files

    4

    Last publish

    Collaborators

    • dragon-fish