text-readability-scores
v1.0.0
Published
Calculate Flesch Reading Ease and Flesch-Kincaid Grade Level scores for any text. For all 6 formulas + keyword analysis, see the TextAnalytics API on RapidAPI.
Downloads
101
Maintainers
Readme
readability-scores
A zero-dependency npm package that calculates Flesch Reading Ease and Flesch-Kincaid Grade Level scores for any text.
Install
npm install readability-scoresUsage
import { readability } from 'readability-scores';
const scores = readability('Your text here. Keep it simple and clear.');
console.log(scores);
// {
// fleschReadingEase: 74.3,
// fleschKincaidGrade: 5.1,
// sentences: 2,
// words: 9,
// syllables: 12
// }What you get
| Field | Description |
|-----------------------|--------------------------------------------------------------|
| fleschReadingEase | Score 0–100. Higher = easier. 60–70 is plain English. |
| fleschKincaidGrade | U.S. school grade level needed to understand the text. |
| sentences | Number of sentences detected. |
| words | Number of words. |
| syllables | Total syllable count. |
Flesch Reading Ease reference
| Score | Difficulty | |-----------|-------------------| | 90–100 | Very Easy | | 80–90 | Easy | | 70–80 | Fairly Easy | | 60–70 | Standard | | 50–60 | Fairly Difficult | | 30–50 | Difficult | | 0–30 | Very Confusing |
Limitations
This package provides two scores only:
- No Gunning Fog, SMOG, Coleman-Liau, or Automated Readability Index
- No keyword density analysis
- No n-gram extraction
- No reading time or speaking time estimates
- Syllable counting is heuristic-based (English only)
Need more?
For all 6 readability formulas plus keyword density, n-gram analysis, and reading/speaking time, check out the TextAnalytics API on RapidAPI.
License
MIT
