Neurotic and Probably Misinformed
Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

retext

6.0.1 • Public • Published

retext Build Coverage Downloads Size Chat

retext is a natural language processor powered by plugins part of the unified collective.

Don’t need the parser? Or the compiler? That’s OK.


Announcing the unified collective! 🎉 Read more about it on Medium »

Sponsors



🥇 ZEIT


🥇 Gatsby


🥉 Compositor


Holloway




You?

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')
 
var doc = 'He’s set on beating your butt for sheriff! :cop:'
 
retext()
  .use(profanities)
  .use(emoji, {convert: 'encode'})
  .process(doc, 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

install

npm i retext

Downloadsweekly downloads

16,780

version

6.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability