npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

retext-assuming

v1.0.0

Published

Check for unhelpful ‘assuming’ phrases such as ‘just’, ‘simply’ or ‘obviously’ with retext

Downloads

174

Readme

retext-assuming

npm version XO code style GitHub license

Check for unhelpful ‘assuming’ phrases such as 'just', 'simply' or 'obviously' with retext.

Using these phrases in documentation is unhelpful: “simple” is relative to a users’ knowledge and experience. Often it is fine to leave the phrase out completely:

Avoid:

“Simply run the tests. Just type npm test…”

But use:

“To run the tests type npm test…”

Credits

This plugin is based on the excellent retext (plugins) by Wooorm. Not much of this code is original and it probably could be much improved. PR's welcome 🚀

Installation

Install through npm:

npm install retext-assuming

Usage

Say we have the following file, example.txt:

You can just import an ES6 module.
Everything is simply Javascript.
Obviously you would need NodeJS > 8.
Actually, it's quite easy to use.

And our script, example.js, looks as follows:

var vfile = require('to-vfile');
var report = require('vfile-reporter');
var retext = require('retext');
var dontAssume = require('retext-assuming');

retext()
  .use(dontAssume)
  .process(vfile.readSync('example.txt'), function (err, file) {
    console.error(report(err || file));
  });

Should result in:

example.txt
   1:9-1:13  warning  Avoid “just”, it's not helpful       no-just       retext-assuming
  2:15-2:21  warning  Avoid “simply”, it's not helpful     no-simply     retext-assuming
   3:1-3:10  warning  Avoid “Obviously”, it's not helpful  no-obviously  retext-assuming
    4:1-4:9  warning  Avoid “Actually”, it's not helpful   no-actually   retext-assuming
  4:22-4:26  warning  Avoid “easy”, it's not helpful       no-easy       retext-assuming

⚠ 3 warnings

API

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

Checks for unhelpful phrases such as “just”, “simply” or “obviously” in processed text.

NOTE dontAssume is the assigned name of our required module. You can name it however you like.

options.phrases

Array.<string> — list of phrases to warn about (defaults to phrases.json)

options.ignore

Array.<string> — phrases not to warn about.

options.verbose

Boolean — If true includes matches that are probably fine (“You should not simply assume”)

Related

License

MIT © David Hund