Check for profane and vulgar wording with retext.
npm:
npm install retext-profanities
retext-profanities is also available for duo, and as an AMD, CommonJS, and globals module, uncompressed and compressed.
var retext = require('retext');
var profanities = require('retext-profanities');
var report = require('vfile-reporter');
retext()
.use(profanities)
.process([
'He’s pretty set on beating your butt for sheriff.'
].join('\n'), function (err, file) {
console.log(report(file));
});
Yields:
<stdin>
1:33-1:37: Don’t use “butt”, it’s profane
⚠ 5 warnings
Check for profane and vulgar wording.
Parameters
-
profanities
— This plug-in; -
options
(Object?
, optional):ignore
(Array.<string>
) — List of phrases to not warn about.