Check phrases for simpler alternatives with retext.
npm:
npm install retext-simplify
retext-simplify is also available as an AMD, CommonJS, and globals module, uncompressed and compressed.
var retext = require('retext');
var simplify = require('retext-simplify');
var report = require('vfile-reporter');
retext()
.use(simplify)
.process([
'You can utilize a shorter word.',
'Be advised, don’t do this.',
'That’s the appropriate thing to do.'
].join('\n'), function (err, file) {
console.log(report(file));
});
Yields:
<stdin>
1:9-1:16 warning Replace “utilize” with “use” utilize
2:1-2:11 warning Remove “Be advised” be advised
3:12-3:23 warning Replace “appropriate” with “proper”, “right”, or remove it appropriate
⚠ 3 warnings
Check phrases for simpler alternatives.
ignore
(Array.<string>
) — phrases not to warn about.