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

@alexneri/readability-ts

v0.7.5

Published

A CLI app that runs the Flesch-kincaid readability score recursively on all *.adoc files in the current directory.

Downloads

291

Readme

Readability Score Tester (Folder)

A CLI app that runs the Flesch-kincaid readability score recursively on all *.adoc files in the current directory.

Overview

This is a javascript app that scans a folder for your files, filters out code and formatting, and generates a readability score based on Flesch-Kincaid tests. The higher the score, the easier it is to read and understand your document.

Flow

This application does the following:

  1. Recursively scan the entire folder
  2. For every *.adoc file, analyse the content:
    1. Copy the contents
    2. Remove code block formatting and any asciidoc-related tags (e.g. ==, ===, ----, ...., etc.)
    3. Compute the flesch-kincaid readabilty score of the contents
    4. Prepend the score to the file as a comment in the following template: // Readability score: <score>: <rating>
      • For the rating, use the following system for ratings:
        • Score is 91-100 - Very easy to read. Easily understood by an average 11-year-old student.'
        • Score is 81-90 - '6th grade level - Very easy to read. Easily understood by an average 11-year-old student'
        • Score is 71-80 - '7th grade level - Fairly easy to read.'
        • Score is 61-70- '8th & 9th grade - Plain English. Easily understood by 13- to 15-year-old students.'
        • Score is 51-60 - '10th - 12th grade - Fairly difficult to read.'
        • Score is 41-50 - 'College - Difficult to read.'
        • Score is 31-40 'College grad - Very difficult to read. Best understood by university graduates.'
        • Score is 0-30 'Professional - Extremely difficult to read. Best understood by university graduates.'
  3. Save the list of files (include the directory tree from the top-level folder where the command is run) and their readability scores to a file called scores.txt in the same top-level folder the command is run.
  4. While the application is running, display a progress bar that shows the percentage of files processed.
  5. After the command is complete, display the following message: Readability scores computed! Total files: <total files> processed in <total time>. Summary of scores are saved to scores.txt

Installation

There are two ways for you to install this tool:

Install via npm (Recommended)

  1. Run npm install @alexneri/readability-ts -g.

via this CLI

  1. Clone the repository: git clone [email protected]:alexneri/readability-folder-ts.git
  2. Open terminal.
  3. Navigate to the folder.
  4. Run npm install to install the dependencies.
  5. Run npm link

Usage

Enter command readability-ts /path/to/folder and replace the path with the folder you want to scan (relative to the folder you run this command).

License


This program is free software licensed under GNU GPL v3 or later.

You have the freedom to:
- Use this program for any purpose
- Study and modify the source code
- Share the program with others
- Share your modifications with others

If you share this program or any modifications:
- You must provide the source code
- You must license it under GNU GPL v3
- You must preserve copyright notices

This program comes with no warranty.

For the full license text see: GNU GPL v3

A donation is not required, but it is appreciated. If you find this program useful, please consider sponsoring me :)

Roadmap

  • ~~Make this installable on npm~~ DONE
  • Add more tests
  • Add more documentation
  • Add more supported file formats
  • Add more supported languages
  • Add more supported readability tests

For feature requests, please open an issue on the repository.

For further reading

  • Wikipedia Article: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests
  • Research Paper: https://psycnet.apa.org/doiLanding?doi=10.1037%2Fh0057532