Skip to content

sparkartgroup/retext-simplify

 
 

Repository files navigation

retext-simplify Build Status Coverage Status

Check phrases for simpler alternatives with retext.

Installation

npm:

npm install retext-simplify

retext-simplify is also available as an AMD, CommonJS, and globals module, uncompressed and compressed.

Usage

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

API

retext().use(simplify[, options])

Check phrases for simpler alternatives.

options
  • ignore (Array.<string>) — phrases not to warn about.

License

MIT © Titus Wormer

About

Check phrases for simpler alternatives

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%