node package manager

retext

retext Build Status Coverage Status Chat

The retext processor is a natural language processor powered by plug-ins.

Don’t need the parser, or another parser? That’s OK.

Installation

npm:

npm install retext

Usage

var retext = require('retext');
var profanities = require('retext-profanities');
var emoji = require('retext-emoji');
var report = require('vfile-reporter');
 
retext()
  .use(profanities)
  .use(emoji, {convert: 'encode'})
  .process('He’s set on beating your butt for sheriff! :cop:', function (err, file) {
    console.log(String(file));
    console.error(report(err || file));
  });

Yields:

He’s set on beating your butt for sheriff! 👮
  1:26-1:30  warning  Be careful with “butt”, it’s profane in some cases  butt  retext-profanities
 
⚠ 1 warning

License

MIT © Titus Wormer