Socket
Socket
Sign inDemoInstall

retext-repeated-words

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

retext-repeated-words

Check for for repeated words


Version published
Weekly downloads
16K
increased by0.68%
Maintainers
1
Weekly downloads
 
Created
Source

retext-repeated-words Build Coverage Downloads Chat

Check for for repeated words with retext.

Installation

npm:

npm install retext-repeated-words

Usage

Say we have the following file, example.txt:

Well, it it doesn’t have to to be. Like a fish in the
the sea.

And our script, example.js, looks like this:

var vfile = require('to-vfile')
var report = require('vfile-reporter')
var unified = require('unified')
var english = require('retext-english')
var stringify = require('retext-stringify')
var repeated = require('retext-repeated-words')

unified()
  .use(english)
  .use(repeated)
  .use(stringify)
  .process(vfile.readSync('example.txt'), function(err, file) {
    console.error(report(err || file))
  })

Now, running node example yields:

example.txt
   1:7-1:12  warning  Expected `it` once, not twice   retext-repeated-words  retext-repeated-words
  1:26-1:31  warning  Expected `to` once, not twice   retext-repeated-words  retext-repeated-words
   1:51-2:4  warning  Expected `the` once, not twice  retext-repeated-words  retext-repeated-words

⚠ 3 warnings

API

retext().use(repeatedWords)

Check for repeated words.

  • Doesn’t warn for some words which do occur twice (the best exhibition they had had since)
  • Doesn’t warn for initialisms (D. D. will pop up with...)
  • Doesn’t warn for capitalised words (Duran Duran...)

Contribute

See contributing.md in retextjs/retext for ways to get started.

This organisation has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Keywords

FAQs

Package last updated on 03 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc