
Security News
PyPI Expands Trusted Publishing to GitLab Self-Managed as Adoption Passes 25 Percent
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads
automated-readability
Advanced tools
Formula to detect the ease of reading a text according to the Automated Readability Index (1967)
Formula to detect the ease of reading a text according to the automated readability index.
This package exposes an algorithm to detect ease of reading of English texts.
You’re probably dealing with natural language, and know you need this, if you’re here! This algorithm isn’t based on syllabbles compared to some other algorithms, which means it’s quicker to calculate.
This package is ESM only. In Node.js (version 14.14+, 16.0+), install with npm:
npm install automated-readability
In Deno with esm.sh:
import {automatedReadability} from 'https://esm.sh/automated-readability@2'
In browsers with esm.sh:
<script type="module">
import {automatedReadability} from 'https://esm.sh/automated-readability@2?bundle'
</script>
import {automatedReadability} from 'automated-readability'
// For:
//
// The rule of rhythm in prose is not so intricate. Here,
// too, we write in groups, or phrases, as I prefer to call
// them, for the prose phrase is greatly longer and is much
// more nonchalantly uttered than the group in verse; so
// that not only is there a greater interval of continuous
// sound between the pauses, but, for that very reason,
// word is linked more readily to word by a more summary
// enunciation. Still, the phrase is the strict analogue
// of the group, and successive phrases, like successive
// groups, must differ openly in length and rhythm. The
// rule of scansion in verse is to suggest no measure but
// the one in hand; in prose, to suggest no measure at all.
// Prose must be rhythmical, and it may be as much so as
// you will; but it must not be metrical. It may be
// anything, but it must not be verse.
//
// Containing 6 sentences, 151 words, and 623 characters.
automatedReadability({
sentence: 6,
word: 151,
character: 623
})
// => 10.585982…
This package exports the identifier automatedReadability.
There is no default export.
automatedReadability(counts)Given an object containing the number of words (word), the number of
sentences (sentence), and the number of characters (character) in a
document, returns the grade level associated with the document.
countsCounts from input document.
counts.sentenceNumber of sentences (number, required).
counts.wordNumber of words (number, required).
counts.characterNumber of characters (number, required).
Grade level associated with the document (number).
This package is fully typed with TypeScript.
It exports the additional type Counts.
This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. It also works in Deno and modern browsers.
coleman-liau
— uses letter count instead of an error-prone syllable parserdale-chall-formula
— uses a dictionary, suited for higher reading levelsflesch
— uses syllable countflesch-kincaid
— like flesch-formula, returns U.S. grade levelsgunning-fog
— uses syllable count, hard to implement (needs POS-tagging and NER)smog-formula
— like gunning-fog-index, without the need for advanced NLP tasksspache-formula
— uses a dictionary, suited for lower reading levelsYes please! See How to Contribute to Open Source.
This package is safe.
FAQs
Formula to detect the ease of reading a text according to the Automated Readability Index (1967)
The npm package automated-readability receives a total of 2,707 weekly downloads. As such, automated-readability popularity was classified as popular.
We found that automated-readability demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

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.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.