{"_id":"profanity-cleaner","_rev":"2-78bb41630a186ca192cde730ff4a6580","name":"profanity-cleaner","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"profanity-cleaner","version":"0.0.1","description":"","main":"dist/index.js","type":"commonjs","author":{"name":"DevXprite","email":"devXprite@gmail.com"},"license":"GPL-3.0","scripts":{"test":"mocha","build":"webpack","dev":"webpack --progress --watch","lint":"eslint .","lint:fix":"eslint . --fix"},"keywords":[],"devDependencies":{"@babel/cli":"^7.19.3","@babel/core":"^7.20.5","@babel/preset-env":"^7.20.2","babel-loader":"^9.1.0","chai":"^4.3.7","eslint":"^7.32.0 || ^8.2.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^8.5.0","eslint-plugin-import":"^2.25.2","mocha":"^10.2.0","prettier":"^2.8.1","webpack":"^5.75.0","webpack-cli":"^5.0.1"},"gitHead":"c86875f107db273b5b500d966db50646677b648d","_id":"profanity-cleaner@0.0.1","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-ECj6MKXiBYGHKvRlRnTHibXnsw5N4JUphiJt6J5dTYsXNcR8mpSZnlvcor6AisCzm4N2LFNXfcaj8JdDRCD1xg==","shasum":"70832e3e45aed5f3e14c8aff2b98d36d42b32d1d","tarball":"https://registry.npmjs.org/profanity-cleaner/-/profanity-cleaner-0.0.1.tgz","fileCount":15,"unpackedSize":51435,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFnj8X9dSo2M24flH1BnylBCkDrToWqk8cYwyUgNMiROAiBWJQKhc+7vVdk/BbNze9kWyH/FifS8ZojWlN2PNmD/vw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpHhjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrE3g//ZyEO92Vaj4G7xpbIrERzZu67xaSoD0pwkOaUsE7/eLsBKtUU\r\nHVlMRaxF6g6IGqeqE4BP+Uz+DTW+l9RIFHnZvmsmj/ZS590y8eZIYv5FQlAn\r\nccBXLGa4BGA9mlvUod+fEjWHybqWuGEGyF+6BxXlpu4Qdy5SX+T1Q/fXC2aF\r\nssH67JohZfbJMJ0h3Dw4qAdux0D3XG5nVkHFZ9I4da9ZvABlZSw/jablW+SO\r\neUQNfXCGf3HCFYmBgDckC7iux0ffBTDOfBHjQVo73HGsvo8XiB5C6J60pe4T\r\nBP5LtaLZE15eWiVyT+OQwl/MPyA2Kdi3RDwtML234cU9TOsmuEbpi46+P/TZ\r\nHKhlRYORyO3sUoPGmf7okR6gk9Myfh0t51Ozk2AybwqsS78KMa/ZlCFnjsza\r\nvAmniA8KFiE7ZScMgpS/Jy3YFDwY7X9EZjf74RGDSX1mnFfYAWNH47gFLLeX\r\nixWMtZpuI+m2lS9pMbURzs/uRbceqixBgTOzzPHgnKr625bRzXb6YsCWZQ1l\r\ntS0mG/q59gHJQeBYe0opxhfs7pBit0Oq4Jqqp7q1cwFK2uP7kQMqdv602LVq\r\nJAgcQlK6x6VLvSH5AHziYnZ18wt0cTTUtlKqCzCbhmd2N5sbeJpM/S8U4THq\r\nvA4WlWS+MslstoWMFxC6/5eXHkm85VgmaMc=\r\n=N5rD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"devxprite","email":"devxprite@gmail.com"},"directories":{},"maintainers":[{"name":"devxprite","email":"devxprite@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/profanity-cleaner_0.0.1_1671723107281_0.6199392337032263"},"_hasShrinkwrap":false},"0.0.2":{"name":"profanity-cleaner","version":"0.0.2","description":"","main":"dist/profanity-cleaner.js","type":"commonjs","author":{"name":"DevXprite","email":"devXprite@gmail.com"},"license":"GPL-3.0","scripts":{"test":"mocha","build":"webpack","dev":"webpack --progress --watch","lint":"eslint .","lint:fix":"eslint . --fix"},"keywords":[],"devDependencies":{"@babel/cli":"^7.19.3","@babel/core":"^7.20.5","@babel/preset-env":"^7.20.2","babel-loader":"^9.1.0","chai":"^4.3.7","eslint":"^7.32.0 || ^8.2.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^8.5.0","eslint-plugin-import":"^2.25.2","mocha":"^10.2.0","prettier":"^2.8.1","webpack":"^5.75.0","webpack-cli":"^5.0.1"},"gitHead":"238574185fa02f0d1948bc164dce9d30c2d3a007","_id":"profanity-cleaner@0.0.2","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-LdoH6OwjxIUczzrt0j9EhSWWjh6J6Wk2NNGmCZ7s2Z4IIe4Os+FLTt85bqoAd1ZaqG7/otUC+NETabqR0SC/cQ==","shasum":"876b59ab768ec368142efc2675b8b5ad9656e6eb","tarball":"https://registry.npmjs.org/profanity-cleaner/-/profanity-cleaner-0.0.2.tgz","fileCount":15,"unpackedSize":51448,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHPrtz0hsM+6P5QO8gXmznVif2qAw2dmwSgjKBLF7wygIhAPZ/NFWQWpj4J5zgtac4DAY4Woaxhvh6cs5JjFOaoOju"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpHliACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoysQ/+MnKIhP3aca4wCmQtwHqWg/8SEmC0q7AZDuVHaviuA7AGub5h\r\nOcEfdMoBlkNykWtGD0bLTkpwyGWsALENYCu7LEevNEXEmLzTUverabIxHJ2g\r\nFfIzVA7hQLj82uQedV/1VXL1N3z5wHBXGufodCBeOxUDIaSCWdjpCe9p4kDc\r\nPLkCxv18eHyN/53nweU8LEA395VJyrRoCLuQ/crPGSxX+wXlX7K759iYIOOr\r\nuO0/RHAGdsScWx/Iacfez9WuNoElsaKqJ7AlOSkP274tIUAOqraCZEO+nyhQ\r\nejtcUGIRxyu1MQoXywrWXdu+e1f0hmnhH2i/SMe0P2vWQQ/6IFwyk7NfcwHl\r\n+/v+B5gQ2zEQmTu78d1okE42OfGdmavAKkmPTt6RyhlFHKZjffdmGQqwSvZ0\r\n3SNqTz4b+UA6S8ezLbUlistVVFJGjm/5+Gq+8QSTdku8W7Vw9/lZ28JWJ+o0\r\nLSJfa2gaBDKKNfrNOiWC/Xk1HnXn6F8HfQ8F4Z3Q4maj5JGaO20YQEmMUyZh\r\nM+1QvJZfaSgHIxZ2QuqW+KbobvCkU55YRHI6icKj5nuJQ4ObE4Y6d0cKMw7C\r\n6EDGlqwqa9/bajwY10yvTQYfPLY6wFqqhjSQp8SajsRrkmnS1RWtB6MAaAov\r\nuCiuSbaWkF9eHqsDDXc+lI5FFWDvbBzS3sM=\r\n=uQSV\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"devxprite","email":"devxprite@gmail.com"},"directories":{},"maintainers":[{"name":"devxprite","email":"devxprite@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/profanity-cleaner_0.0.2_1671723362142_0.437839061924278"},"_hasShrinkwrap":false},"0.0.3":{"name":"profanity-cleaner","version":"0.0.3","description":"A simple and lightweight JavaScript library that helps you clean profane or inappropriate words from a given text","main":"dist/profanity-cleaner.js","type":"commonjs","license":"MIT","author":{"name":"Prateek Singh","email":"devXprite@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/devXprite/profanity-cleaner.git"},"homepage":"https://github.com/devXprite/profanity-cleaner","keywords":["profanity","badwords","bad-words","badwords-filter","profanity-cleaner","profanity-filter","profanity-cleaner"],"devDependencies":{"@babel/cli":"^7.19.3","@babel/core":"^7.20.5","@babel/preset-env":"^7.20.2","babel-loader":"^9.1.0","chai":"^4.3.7","eslint":"^7.32.0 || ^8.2.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^8.5.0","eslint-plugin-import":"^2.25.2","mocha":"^10.2.0","prettier":"^2.8.1","webpack":"^5.75.0","webpack-cli":"^5.0.1"},"scripts":{"test":"mocha","build":"webpack","dev":"webpack --progress --watch","lint":"eslint .","lint:fix":"eslint . --fix"},"bugs":{"url":"https://github.com/devXprite/profanity-cleaner/issues"},"_id":"profanity-cleaner@0.0.3","_integrity":"sha512-i5jUt2Xoi4nAUFoEFeCefWpXCsQhE0NPni9x7+nhW5hJA5SvXqWFzu+FeKtzcmYO/RHWZN6p0LYhXg8NOVHcpA==","_resolved":"/tmp/ca08bbaee5e01ee8a96234d92861d571/profanity-cleaner-0.0.3.tgz","_from":"file:profanity-cleaner-0.0.3.tgz","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-i5jUt2Xoi4nAUFoEFeCefWpXCsQhE0NPni9x7+nhW5hJA5SvXqWFzu+FeKtzcmYO/RHWZN6p0LYhXg8NOVHcpA==","shasum":"4224396b124edd8d5ed1b7aadbe226bb64c00e06","tarball":"https://registry.npmjs.org/profanity-cleaner/-/profanity-cleaner-0.0.3.tgz","fileCount":16,"unpackedSize":55370,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHlGrxv7jHoptmv+rHFTh7anBcKYUYEpeAhJOmshegmwIhAOoVieZxaW2YpnNsWhQ9s1lKP6FaSCjq3yXSC4m+EvWV"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj38MxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoIwBAAjCRXs+eHrRZujXwZHTrhXHVQ76cK9bEAhSHnjKZedU8mO9D/\r\nDU0w0Mz+WVYlKAiYaTu++VVJD2S8OANA9NhybOF72n0fj495s2YSRjtwq3am\r\ncYghkbTQVYfZ5FFb6Pi8lGSNw+7jyuEo600g38La0wY97Bm/vZO5xDyhRlSR\r\ny++ZcTXrWMJJsJWtsYsUtdFaErDQmXj4ppGIP60Q/IVY+9c8N8DEmbKFz5jJ\r\nbJPZ/6X4b+OuielZt/H6xpLOtz/vDO40aHiMrxmH1D9cud6gPDmYzNNrkUhG\r\nzdbbeCBKBUx35mNCEQNYf5b+jLmbS2ZhFqmsZPK/iIZcS/Z9TStUrZKNqadB\r\nqctZX2y6M04citOXcUeNWqFU81qppZDgPUQZBHRZEOOokunnbzmjTgF5g52n\r\n0St1gq9A/1i7Eo7SCuT8C7Z1SKU1mixRM33Rb5tmRMOxvfqrR4uAynqA1RZd\r\nO6sY58lCvxvfVAxoVls6iLQv+uMBOesLWsO7fzVCPJ1mM4X0ZKnRzBSRbxWZ\r\nJ7OZdIVIYpPMuhFHixuv3PkL8lIjsZr1i3GEs5qVaDvzrchEPzx3KH2Ihe0o\r\nX367lSNlBOT7YJQMI80HC3HM6y7UGYhXMGa5gBVoQh6GK4wtjA94GvJKxSiH\r\nriJ4EV1p3xXWtj6ogkyhifZiyw6Tlk3wByw=\r\n=sG9+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"devxprite","email":"devxprite@gmail.com"},"directories":{},"maintainers":[{"name":"devxprite","email":"devxprite@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/profanity-cleaner_0.0.3_1675608881089_0.9921771140194071"},"_hasShrinkwrap":false}},"time":{"created":"2022-12-22T15:31:47.280Z","0.0.1":"2022-12-22T15:31:47.436Z","modified":"2023-02-05T14:54:41.348Z","0.0.2":"2022-12-22T15:36:02.379Z","0.0.3":"2023-02-05T14:54:41.258Z"},"maintainers":[{"name":"devxprite","email":"devxprite@gmail.com"}],"keywords":["profanity","badwords","bad-words","badwords-filter","profanity-cleaner","profanity-filter","profanity-cleaner"],"author":{"name":"Prateek Singh","email":"devXprite@gmail.com"},"license":"MIT","readme":"## profanity-cleaner\n\nA simple and lightweight JavaScript library that helps you clean profane or inappropriate words from a given text. It provides a simple API that you can use to filter out bad words and replace them with asterisks or any other character of your choice. The library uses a predefined list of bad words that can be customized to fit your specific requirements.\n\n### Installation\nTo install the package, run the following command:\n\n```bash\nnpm install profanity-cleaner\n```\n\n## Usage\n\n### use in Browser\n\nUse directly in the browser with [jsDelivr](https://www.jsdelivr.com/package/npm/profanity-cleaner) or [unpkg](https://unpkg.com/profanity-cleaner/) by including the following script tag in your HTML file.\n\n```html\n<!DOCTYPE html>\n<html>\n    <head>\n        <meta charset=\"utf-8\">\n        <title>Profanity Cleaner</title>\n    </head>\n    <body>\n        <script src=\"https://cdn.jsdelivr.net/npm/profanity-cleaner@latest\"></script>\n        <script>\n            const text = \"What the hell is going on?\";\n            const cleanedText = profanityCleaner.clean(text);\n\n            console.log(cleanedText) // What the **** is going on?\n        </script>\n    </body>\n</html>\n```\n\n### use as a module\nImport the clean function and call it with a string argument to censor bad words in the text.\n\n```javascript\nimport { clean } from 'profanity-cleaner';\n\nconst text = \"Don't be an ash0le\";\nconsole.log(clean(text)) // Don't be an ******\n```\n\n### Options\nYou can pass options to the clean function as a second argument. The following options are available:\n\n#### `placeholder`\n\n*Type* : `string`  \n*Default* : `*`\n\nThe character to use as a placeholder for the bad words.\n\n```javascript\nimport { clean } from 'profanity-cleaner';\n\nconst text = \"This is a funck!ng test\";\n\nconsole.log(clean(text, { placeholder: '#' })) \n// OUTPUT: This is a f####g test\n```\n\n#### `customReplacement`\n\n*Type* : `function`  \n*Default* : `null`\n\nA function that returns a string to replace the bad words with. The function is passed the bad word as an argument.\n\n```javascript\nimport { clean } from 'profanity-cleaner';\n\nconst text = \"This is a funck!ng test\";\n\nconsole.log(clean(text, { customReplacement: (word) => word.toUpperCase() }))\n// OUTPUT: This is a FUNCK!NG test\n```\n\n#### `keepFirstAndLastChar`\n\n*Type* : `boolean`  \n*Default* : `false`\n\nWhether to keep the first and last character of the bad word.\n\n```javascript\nimport { clean } from 'profanity-cleaner';\n\nconst text = \"This is a funck!ng test\";\n\nconsole.log(clean(text, { keepFirstAndLastChar: true }))\n// OUTPUT: This is a f****g test\n```\n\n#### `customMatch`\n\n*Type* : `function`  \n*Default* : `null`\n\nA function that returns a boolean to determine whether a word should be censored. The function is passed the bad word as an argument. In the following example, only words with an odd number of characters are censored.\n\n```javascript\nimport { clean } from 'profanity-cleaner';\n\nconst text = \"This is a funck!ng test\";\n\nconsole.log(clean(text, { customMatch: (word) => word.length % 2 != 0 }))\n// OUTPUT: This is a f*****g test\n```\n\n#### `exceptions`\n\n*Type* : `array`  \n*Default* : `[]`\n\nAn array of words that should not be censored. In the following example, the word `hell` is not censored.\n\n```javascript\nimport { clean } from 'profanity-cleaner';\n\nconst exceptionalWords = ['hell'];\nconst text = \"What the hell is going on?\";\n\nconsole.log(clean(text, { exceptions: exceptionalWords }))\n// OUTPUT: What the hell is going on?\n```\n\n#### `customBadWords`\n\n*Type* : `array`\n\nAn array of words that should be censored. In the following example, the word `bad` is censored.\n\n```javascript\nimport { clean } from 'profanity-cleaner';\n\nconst badWordsArray = ['bad', 'evil'];\nconst text = \"This is a bad example\";\n\nconsole.log(clean(text, { customBadWords: badWordsArray }))\n\n// OUTPUT: This is a *** example\n```\n\n\n## Credits\n* The list of bad words used in this library was sourced from the [badwords](https://github.com/web-mech/badwords) project.\n\n## License\n`profanity-cleaner` is released under the [MIT License](LICENSE).","readmeFilename":"Readme.md","description":"A simple and lightweight JavaScript library that helps you clean profane or inappropriate words from a given text","homepage":"https://github.com/devXprite/profanity-cleaner","repository":{"type":"git","url":"git+https://github.com/devXprite/profanity-cleaner.git"},"bugs":{"url":"https://github.com/devXprite/profanity-cleaner/issues"}}