npm_word_filter
v1.0.3
Published
A package that replace forbiden words with "*" characters according to the word's length
Downloads
2
Maintainers
Readme
This is a demo - package
This package allows you to modify bad words by modifying that string into one containg as many "*" characters according to the word's length.
In order to use this package, one has to call the function badWordReplace by passing a string as parameter, which will be compared with an array of forbiden words.
If the parameter is match with any of the words stored in the array it will be modified by maintaining the first two letters of the word and replacing the remaining letters for "*" character.
An example of how to call the function would be;
const {badWordReplace} = require('npm_word_filter')
console.log(badWordReplace("Bastard"))