@power-seo/readability
Advanced tools
+21
| MIT License | ||
| Copyright (c) 2026 CCBD SEO Contributors | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
+13
-13
| { | ||
| "name": "@power-seo/readability", | ||
| "version": "1.0.8", | ||
| "version": "1.0.10", | ||
| "description": "Readability scoring algorithms (Flesch-Kincaid, Gunning Fog, Coleman-Liau, ARI) with configurable thresholds", | ||
@@ -20,14 +20,4 @@ "license": "MIT", | ||
| ], | ||
| "scripts": { | ||
| "build": "tsup", | ||
| "dev": "tsup --watch", | ||
| "test": "vitest run", | ||
| "test:watch": "vitest", | ||
| "typecheck": "tsc --noEmit", | ||
| "lint": "eslint src/", | ||
| "lint:fix": "eslint src/ --fix", | ||
| "clean": "rimraf dist" | ||
| }, | ||
| "dependencies": { | ||
| "@power-seo/core": "workspace:*" | ||
| "@power-seo/core": "1.0.10" | ||
| }, | ||
@@ -64,3 +54,13 @@ "devDependencies": { | ||
| "url": "https://github.com/sponsors/cybercraftbd" | ||
| }, | ||
| "scripts": { | ||
| "build": "tsup", | ||
| "dev": "tsup --watch", | ||
| "test": "vitest run", | ||
| "test:watch": "vitest", | ||
| "typecheck": "tsc --noEmit", | ||
| "lint": "eslint src/", | ||
| "lint:fix": "eslint src/ --fix", | ||
| "clean": "rimraf dist" | ||
| } | ||
| } | ||
| } |
+192
-256
@@ -1,5 +0,11 @@ | ||
| # @power-seo/readability — Readability Scoring for TypeScript — Flesch-Kincaid, Gunning Fog, Coleman-Liau & ARI | ||
| # @power-seo/readability | ||
|  | ||
| Multi-algorithm readability scoring for TypeScript — Flesch Reading Ease, Flesch-Kincaid, Gunning Fog, Coleman-Liau, and ARI in one unified API with actionable status labels. | ||
| [](https://www.npmjs.com/package/@power-seo/readability) | ||
| [](https://www.npmjs.com/package/@power-seo/readability) | ||
| [](https://socket.dev/npm/package/@power-seo/readability) | ||
| [](https://github.com/CyberCraftBD/power-seo/actions) | ||
| [](https://opensource.org/licenses/MIT) | ||
@@ -9,42 +15,25 @@ [](https://www.typescriptlang.org/) | ||
| --- | ||
| `@power-seo/readability` runs five industry-standard readability formulas against any text or HTML string and returns structured, typed score objects with numeric values and `'good'` / `'improvement'` / `'error'` status labels — comparable to the readability scoring panels in Yoast SEO or Hemingway App, but as a standalone TypeScript library. Run it server-side in a CMS pipeline, client-side in a React editor, or inside a CI content quality gate. All five algorithm functions are independently importable and tree-shakeable. | ||
| ## Overview | ||
| > **Zero runtime dependencies** — pure TypeScript, no NLP libraries, works in any JavaScript environment. | ||
| **@power-seo/readability** is a **multi-algorithm readability scoring engine** for **TypeScript/JavaScript developers and SEO engineers** that helps you **measure, classify, and improve the reading ease of web content**. | ||
| **What it does** | ||
| - ✅ **Scores content with 5 industry-standard readability formulas** (Flesch, Flesch-Kincaid, Gunning Fog, Coleman-Liau, ARI) | ||
| - ✅ **Returns structured, actionable status labels** (`'good'` / `'improvement'` / `'error'`) with human-readable messages | ||
| - ✅ **Works in Node.js and the browser** with zero runtime dependencies | ||
| **What it is not** | ||
| - ❌ **Not an NLP or AI writing tool** — it scores and classifies; it does not rewrite content | ||
| - ❌ **Not a grammar or spell checker** — readability metrics only | ||
| **Recommended for** | ||
| - **SaaS marketing teams, content editors, and SEO engineers** building automated content scoring pipelines, CMS integrations, or editorial dashboards | ||
| --- | ||
| ## Why @power-seo/readability Matters | ||
| ## Why @power-seo/readability? | ||
| **The problem** | ||
| | | Without | With | | ||
| | ------------------ | --------------------------------------------------- | --------------------------------------------------------------------------------------- | | ||
| | Algorithm coverage | ❌ One-off Flesch score, no other algorithms | ✅ Five algorithms in one call — Flesch, Flesch-Kincaid, Gunning Fog, Coleman-Liau, ARI | | ||
| | Status labels | ❌ Raw numbers only — interpret thresholds manually | ✅ `'good'` / `'improvement'` / `'error'` per score with a human message | | ||
| | HTML input | ❌ Must strip HTML before calling | ✅ HTML tags stripped automatically | | ||
| | Composite status | ❌ No aggregate result | ✅ `overall.status` combines all five algorithms | | ||
| | TypeScript | ❌ Untyped result objects | ✅ Full type inference for all inputs and outputs | | ||
| | CI integration | ❌ Manual threshold checks | ✅ `overall.status === 'error'` fails builds | | ||
| | Framework support | ❌ Browser-only or Node-only tools | ✅ Works in Next.js, Remix, Gatsby, Vite, Edge, browser | | ||
| - **Hard-to-read content increases bounce rates** and reduces time-on-page signals Google uses for ranking | ||
| - **No consistent readability standard** — teams use different tools with inconsistent scoring, leading to content that ships without a readability check | ||
| - **Manual review doesn't scale** — large programmatic SEO sites and content pipelines need automated, per-page readability scoring | ||
|  | ||
| **Why developers care** | ||
| - **SEO:** Google's guidelines favor content written for humans — readability signals content quality | ||
| - **UX:** Lower reading complexity reduces cognitive load, improving engagement and conversion | ||
| - **Performance:** Catching over-complex copy early reduces editorial cycles and re-work | ||
| --- | ||
| ## Key Features | ||
| ## Features | ||
@@ -59,17 +48,49 @@ - **Flesch Reading Ease** — 0–100 score; higher = easier; target 60–70 for most web content | ||
| - **Status labels** — each score maps to `'good'` / `'improvement'` / `'error'` with a human message | ||
| - **HTML stripping** — HTML tags are removed automatically before scoring; no preprocessing required | ||
| - **Zero runtime dependencies** — pure TypeScript; no NLP libraries | ||
| - **Tree-shakeable** — import only the algorithms you need | ||
| - **Type-safe API** — TypeScript-first with full type inference | ||
| - **Tree-shakeable** — import only the algorithms you need; `"sideEffects": false` | ||
| - **Type-safe API** — TypeScript-first with full type inference for all inputs and outputs | ||
| - **Framework-agnostic** — works in Node.js, browser, Next.js, Remix, Gatsby, Vite, Edge | ||
|  | ||
| --- | ||
| ## Benefits of Using @power-seo/readability | ||
| ## Comparison | ||
| - **Improved content quality**: Catch over-complex copy before it ships — not after your rankings drop | ||
| - **Better SEO signals**: Content written at the right reading level aligns with Google's helpful content guidelines | ||
| - **Faster editorial review**: Automated scoring replaces manual readability checks across large content pipelines | ||
| - **Consistent standards**: One package enforces the same readability thresholds across your whole codebase | ||
| | Feature | @power-seo/readability | text-readability | readability-scores | flesch | | ||
| | -------------------------------------- | :--------------------: | :--------------: | :----------------: | :----: | | ||
| | Flesch Reading Ease | ✅ | ✅ | ✅ | ✅ | | ||
| | Flesch-Kincaid Grade | ✅ | ✅ | ✅ | ❌ | | ||
| | Gunning Fog Index | ✅ | ✅ | ✅ | ❌ | | ||
| | Coleman-Liau Index | ✅ | ✅ | ✅ | ❌ | | ||
| | Automated Readability Index | ✅ | ✅ | ✅ | ❌ | | ||
| | Status labels (good/improvement/error) | ✅ | ❌ | ❌ | ❌ | | ||
| | Unified multi-algorithm API | ✅ | ❌ | ❌ | ❌ | | ||
| | Composite overall status | ✅ | ❌ | ❌ | ❌ | | ||
| | HTML auto-stripping | ✅ | ❌ | ❌ | ❌ | | ||
| | TypeScript-first with full types | ✅ | ❌ | ❌ | ❌ | | ||
| | Zero runtime dependencies | ✅ | ✅ | ✅ | ✅ | | ||
| | Tree-shakeable individual functions | ✅ | ❌ | ❌ | ✅ | | ||
|  | ||
| --- | ||
| ## Installation | ||
| ```bash | ||
| npm install @power-seo/readability | ||
| ``` | ||
| ```bash | ||
| yarn add @power-seo/readability | ||
| ``` | ||
| ```bash | ||
| pnpm add @power-seo/readability | ||
| ``` | ||
| --- | ||
| ## Quick Start | ||
@@ -90,194 +111,86 @@ | ||
| **What you should see** | ||
| **Status thresholds (per score):** | ||
| - A numeric score for each of the five algorithms | ||
| - A composite `overall.status` of `'good'`, `'improvement'`, or `'error'` | ||
| - A human-readable `message` for each score to surface in dashboards or editorial UIs | ||
| - `good` — score is within the optimal range for web content | ||
| - `improvement` — score is outside the ideal range; consider simplifying | ||
| - `error` — score indicates content is too complex for most web readers | ||
| --- | ||
|  | ||
| ## Installation | ||
| ```bash | ||
| npm i @power-seo/readability | ||
| # or | ||
| yarn add @power-seo/readability | ||
| # or | ||
| pnpm add @power-seo/readability | ||
| # or | ||
| bun add @power-seo/readability | ||
| ``` | ||
| --- | ||
| ## Framework Compatibility | ||
| ## Usage | ||
| **Supported** | ||
| ### Running All Algorithms at Once | ||
| - ✅ **Node.js** — v18+, works in server-side pipelines and CMS build steps | ||
| - ✅ **React / Next.js (App Router & Pages Router)** — use in Server Components or API Routes | ||
| - ✅ **Remix** — use in loaders or actions | ||
| - ✅ **Browser (vanilla JS/TS)** — no DOM APIs required; runs in any JS environment | ||
| - ✅ **Static site generators** (Astro, Gatsby, Eleventy) — run at build time | ||
| `analyzeReadability()` runs all five algorithms and returns a composite `overall` status: | ||
| **Environment notes** | ||
| ```ts | ||
| import { analyzeReadability } from '@power-seo/readability'; | ||
| - **SSR/SSG:** Fully supported — no browser globals used | ||
| - **Edge runtime:** Supported — pure JS with no Node.js-only APIs | ||
| - **Browser-only usage:** Supported — bundle size is minimal with tree-shaking | ||
| const result = analyzeReadability({ | ||
| text: '<h1>React SEO Best Practices</h1><p>Search engine optimization for React applications requires attention to meta tags, structured data, and performance metrics.</p>', | ||
| }); | ||
| --- | ||
| // result.fleschReadingEase → AlgorithmScore | ||
| // result.fleschKincaidGrade → AlgorithmScore | ||
| // result.gunningFog → AlgorithmScore | ||
| // result.colemanLiau → AlgorithmScore | ||
| // result.automatedReadability → AlgorithmScore | ||
| // result.stats → TextStatistics | ||
| // result.overall → AnalysisResult | ||
| ``` | ||
| ## Use Cases | ||
| ### Running Individual Algorithms | ||
| - **Programmatic SEO pages** — score thousands of auto-generated pages at build time | ||
| - **CMS editorial dashboards** — show live readability scores as editors write content | ||
| - **SaaS marketing sites** — gate content publication behind a minimum readability threshold | ||
| - **Blog / content pipelines** — CI check that fails when content is too complex | ||
| - **E-commerce product descriptions** — ensure product copy is accessible to your target audience | ||
| - **Multi-tenant SaaS portals** — per-tenant readability rules for white-label content | ||
| - **Educational platforms** — match content reading level to target student grade | ||
| - **ERP internal documentation** — enforce plain-language standards for internal guides | ||
| Import individual algorithm functions for targeted scoring in performance-sensitive paths. All accept `TextStatistics` and return `AlgorithmScore`: | ||
| --- | ||
| ```ts | ||
| import { computeTextStatistics, fleschReadingEase, gunningFog } from '@power-seo/readability'; | ||
| ## Example Score Result (Before / After) | ||
| const stats = computeTextStatistics('Your plain text here.'); | ||
| const ease = fleschReadingEase(stats); | ||
| const fog = gunningFog(stats); | ||
| ```text | ||
| Before (first draft — too complex): | ||
| - Flesch Reading Ease: 32.1 → 'error' (very difficult; college level) | ||
| - Flesch-Kincaid Grade: 14.3 → 'error' (postgraduate reading level) | ||
| - Gunning Fog: 15.7 → 'error' (too many complex words) | ||
| - Overall: 'error' | ||
| After (simplified rewrite): | ||
| - Flesch Reading Ease: 64.8 → 'good' (standard; 7th–8th grade) | ||
| - Flesch-Kincaid Grade: 7.9 → 'good' (accessible to general audiences) | ||
| - Gunning Fog: 9.2 → 'good' (appropriate complexity) | ||
| - Overall: 'good' | ||
| console.log(ease.score); // 0–100 (higher = easier) | ||
| console.log(fog.score); // grade level | ||
| console.log(ease.status); // 'good' | 'improvement' | 'error' | ||
| ``` | ||
| --- | ||
| ### Inside a CI Content Quality Gate | ||
| ## Implementation Best Practices | ||
| Fail builds when content readability is too low: | ||
| - **Target Flesch Reading Ease 60–70** for most web content (7th–8th grade level) | ||
| - **Keep Gunning Fog below 12** — above 12 means your content requires college-level reading | ||
| - **Use `analyzeReadability()`** for full pipeline scoring; use individual functions when you need only one metric in a hot path | ||
| - **Strip HTML before scoring** — `analyzeReadability()` handles this automatically; individual functions expect plain text | ||
| - **Set per-content-type thresholds** — blog posts and landing pages should target lower grade levels than technical API docs | ||
| - **Surface scores in your CMS** — editors who see scores live produce better first drafts | ||
| ```ts | ||
| import { analyzeReadability } from '@power-seo/readability'; | ||
| --- | ||
| const result = analyzeReadability({ text: pageContent }); | ||
| ## Architecture Overview | ||
| if (result.overall.status === 'error') { | ||
| console.error('Readability check failed:', result.overall.message); | ||
| console.error('Flesch Reading Ease:', result.fleschReadingEase.score); | ||
| console.error('Gunning Fog Index:', result.gunningFog.score); | ||
| process.exit(1); | ||
| } | ||
| ``` | ||
| **Where it runs** | ||
| ### Score Interpretation | ||
| - **Build-time**: Score all pages during SSG/SSR builds; fail CI if thresholds not met | ||
| - **Runtime**: Score content in CMS editors or API routes for real-time feedback | ||
| - **CI/CD**: Integrate as a lint step to enforce readability standards per PR | ||
| | Flesch Reading Ease | Difficulty | Typical Audience | | ||
| | ------------------- | ---------------- | ---------------------------------------------- | | ||
| | 90–100 | Very Easy | 5th grade | | ||
| | 70–90 | Easy | 6th grade | | ||
| | 60–70 | Standard | 7th–8th grade — **ideal for most web content** | | ||
| | 50–60 | Fairly Difficult | High school | | ||
| | 30–50 | Difficult | College | | ||
| | 0–30 | Very Difficult | Academic / professional | | ||
| **Data flow** | ||
| | Grade Level Score | Status | | ||
| | ----------------- | -------------------------------------------- | | ||
| | ≤ 8 | `'good'` — accessible to general audiences | | ||
| | 9–12 | `'improvement'` — consider simplifying | | ||
| | > 12 | `'error'` — too complex for most web readers | | ||
| 1. **Input**: Plain text string (or HTML — tags are stripped automatically) | ||
| 2. **Analysis**: Text is tokenized; sentence, word, syllable, and character counts are computed | ||
| 3. **Scoring**: Each of the five algorithms runs against the text statistics | ||
| 4. **Output**: Typed score objects with numeric values, status labels, and human messages | ||
| --- | ||
| ## Features Comparison with Popular Packages | ||
| | Capability | `text-readability` | `readability-scores` | `flesch` | @power-seo/readability | | ||
| | -------------------------------------- | :----------------: | :------------------: | :------: | :--------------------: | | ||
| | Flesch Reading Ease | ✅ | ✅ | ✅ | ✅ | | ||
| | Flesch-Kincaid Grade | ✅ | ✅ | ❌ | ✅ | | ||
| | Gunning Fog Index | ✅ | ✅ | ❌ | ✅ | | ||
| | Coleman-Liau Index | ✅ | ✅ | ❌ | ✅ | | ||
| | Automated Readability Index | ✅ | ✅ | ❌ | ✅ | | ||
| | Status labels (good/improvement/error) | ❌ | ❌ | ❌ | ✅ | | ||
| | Unified multi-algorithm API | ❌ | ❌ | ❌ | ✅ | | ||
| | TypeScript-first with full types | ❌ | ❌ | ❌ | ✅ | | ||
| | Zero runtime dependencies | ✅ | ✅ | ✅ | ✅ | | ||
| | Tree-shakeable individual functions | ❌ | ❌ | ✅ | ✅ | | ||
| --- | ||
| ## [@power-seo](https://www.npmjs.com/org/power-seo) Ecosystem | ||
| All 17 packages are independently installable — use only what you need. | ||
| ### Ecosystem packages | ||
| | Package | Install | Description | | ||
| | ------------------------------------------------------------------------------------------ | ----------------------------------- | ----------------------------------------------------------------------- | | ||
| | [`@power-seo/core`](https://www.npmjs.com/package/@power-seo/core) | `npm i @power-seo/core` | Framework-agnostic utilities, types, validators, and constants | | ||
| | [`@power-seo/react`](https://www.npmjs.com/package/@power-seo/react) | `npm i @power-seo/react` | React SEO components — meta, Open Graph, Twitter Card, breadcrumbs | | ||
| | [`@power-seo/meta`](https://www.npmjs.com/package/@power-seo/meta) | `npm i @power-seo/meta` | SSR meta helpers for Next.js App Router, Remix v2, and generic SSR | | ||
| | [`@power-seo/schema`](https://www.npmjs.com/package/@power-seo/schema) | `npm i @power-seo/schema` | Type-safe JSON-LD structured data — 20 builders + 18 React components | | ||
| | [`@power-seo/content-analysis`](https://www.npmjs.com/package/@power-seo/content-analysis) | `npm i @power-seo/content-analysis` | Yoast-style SEO content scoring engine with React components | | ||
| | [`@power-seo/readability`](https://www.npmjs.com/package/@power-seo/readability) | `npm i @power-seo/readability` | Readability scoring — Flesch-Kincaid, Gunning Fog, Coleman-Liau, ARI | | ||
| | [`@power-seo/preview`](https://www.npmjs.com/package/@power-seo/preview) | `npm i @power-seo/preview` | SERP, Open Graph, and Twitter/X Card preview generators | | ||
| | [`@power-seo/sitemap`](https://www.npmjs.com/package/@power-seo/sitemap) | `npm i @power-seo/sitemap` | XML sitemap generation, streaming, index splitting, and validation | | ||
| | [`@power-seo/redirects`](https://www.npmjs.com/package/@power-seo/redirects) | `npm i @power-seo/redirects` | Redirect engine with Next.js, Remix, and Express adapters | | ||
| | [`@power-seo/links`](https://www.npmjs.com/package/@power-seo/links) | `npm i @power-seo/links` | Link graph analysis — orphan detection, suggestions, equity scoring | | ||
| | [`@power-seo/audit`](https://www.npmjs.com/package/@power-seo/audit) | `npm i @power-seo/audit` | Full SEO audit engine — meta, content, structure, performance rules | | ||
| | [`@power-seo/images`](https://www.npmjs.com/package/@power-seo/images) | `npm i @power-seo/images` | Image SEO — alt text, lazy loading, format analysis, image sitemaps | | ||
| | [`@power-seo/ai`](https://www.npmjs.com/package/@power-seo/ai) | `npm i @power-seo/ai` | LLM-agnostic AI prompt templates and parsers for SEO tasks | | ||
| | [`@power-seo/analytics`](https://www.npmjs.com/package/@power-seo/analytics) | `npm i @power-seo/analytics` | Merge GSC + audit data, trend analysis, ranking insights, dashboard | | ||
| | [`@power-seo/search-console`](https://www.npmjs.com/package/@power-seo/search-console) | `npm i @power-seo/search-console` | Google Search Console API — OAuth2, service account, URL inspection | | ||
| | [`@power-seo/integrations`](https://www.npmjs.com/package/@power-seo/integrations) | `npm i @power-seo/integrations` | Semrush and Ahrefs API clients with rate limiting and pagination | | ||
| | [`@power-seo/tracking`](https://www.npmjs.com/package/@power-seo/tracking) | `npm i @power-seo/tracking` | GA4, Clarity, PostHog, Plausible, Fathom — scripts + consent management | | ||
| ### Ecosystem vs alternatives | ||
| | Need | Common approach | @power-seo approach | | ||
| | ----------------------- | ---------------------------------------- | ------------------------------------------------------------ | | ||
| | Readability scoring | `text-readability`, `readability-scores` | `@power-seo/readability` — typed, multi-algo, status labels | | ||
| | Content quality scoring | Yoast SEO plugin | `@power-seo/content-analysis` — headless, framework-agnostic | | ||
| | SEO audit | Lighthouse, Screaming Frog | `@power-seo/audit` — programmatic, CI-friendly | | ||
| | Metadata | Next.js metadata API | `@power-seo/meta` + validation rules | | ||
| --- | ||
| ## Enterprise Integration | ||
| **Multi-tenant SaaS** | ||
| - **Per-tenant thresholds**: Configure different minimum readability scores per tenant type (e.g. consumer vs. B2B) | ||
| - **Audit pipelines**: Run readability checks per page type in CI with structured JSON output | ||
| - **Editorial dashboards**: Surface scores per content block in headless CMS integrations | ||
| **ERP / internal portals** | ||
| - **Enforce plain-language standards** for internal knowledge bases and SOPs | ||
| - **Compliance documentation**: Ensure regulatory content meets reading level requirements | ||
| - **Training material scoring**: Match content complexity to target employee role | ||
| **Recommended integration pattern** | ||
| - Run `analyzeReadability()` in CI on all content files | ||
| - Fail build on `overall.status === 'error'` | ||
| - Export scores to JSON artifacts for trend tracking | ||
| - Track per-page readability trends in dashboards | ||
| --- | ||
| ## Scope and Limitations | ||
| **This package does** | ||
| - ✅ Score plain text or HTML content against 5 readability algorithms | ||
| - ✅ Return structured, typed results with numeric scores and status labels | ||
| - ✅ Work in any JavaScript environment (Node.js, browser, edge) | ||
| **This package does not** | ||
| - ❌ Rewrite or suggest rewrites of content (use `@power-seo/ai` for AI-assisted suggestions) | ||
| - ❌ Check grammar, spelling, or factual accuracy | ||
| - ❌ Perform SEO keyword analysis (use `@power-seo/content-analysis` for that) | ||
| --- | ||
| ## API Reference | ||
@@ -321,77 +234,100 @@ | ||
| ### `computeTextStatistics(text)` | ||
| ```ts | ||
| function computeTextStatistics(plainText: string): TextStatistics; | ||
| ``` | ||
| Returns raw statistics used by all algorithm functions. Input must be plain text (no HTML). | ||
| ### Types | ||
| | Type | Definition | | ||
| | ------------------- | ------------------------------------------------------------------ | | ||
| | `ReadabilityInput` | `{ text: string }` | | ||
| | `ReadabilityOutput` | Full result with all five algorithm scores + stats + overall | | ||
| | `TextStatistics` | `{ sentences, words, syllables, characters, avgWordsPerSentence }` | | ||
| | `AlgorithmScore` | `{ score: number; status: AnalysisStatus; message: string }` | | ||
| | `AnalysisStatus` | `'good' \| 'improvement' \| 'error'` | | ||
| | `AnalysisResult` | `{ status: AnalysisStatus; message: string }` | | ||
| | Type | Description | | ||
| | ------------------- | ---------------------------------------------------------------------------------------------------------- | | ||
| | `ReadabilityInput` | `{ text: string }` | | ||
| | `ReadabilityOutput` | Full result with all five algorithm scores + stats + overall | | ||
| | `TextStatistics` | `{ sentences: number; words: number; syllables: number; characters: number; avgWordsPerSentence: number }` | | ||
| | `AlgorithmScore` | `{ score: number; status: AnalysisStatus; message: string }` | | ||
| | `AnalysisStatus` | `'good' \| 'improvement' \| 'error'` | | ||
| | `AnalysisResult` | `{ status: AnalysisStatus; message: string }` | | ||
| ### Score interpretation | ||
| --- | ||
| | Flesch Reading Ease | Difficulty | Typical Audience | | ||
| | ------------------- | ---------------- | ---------------------------------------------- | | ||
| | 90–100 | Very Easy | 5th grade | | ||
| | 70–90 | Easy | 6th grade | | ||
| | 60–70 | Standard | 7th–8th grade — **ideal for most web content** | | ||
| | 50–60 | Fairly Difficult | High school | | ||
| | 30–50 | Difficult | College | | ||
| | 0–30 | Very Difficult | Academic / professional | | ||
| ## Use Cases | ||
| | Grade Level Score | Status | | ||
| | ----------------- | -------------------------------------------- | | ||
| | ≤ 8 | `'good'` — accessible to general audiences | | ||
| | 9–12 | `'improvement'` — consider simplifying | | ||
| | > 12 | `'error'` — too complex for most web readers | | ||
| - **Programmatic SEO pages** — score thousands of auto-generated pages at build time | ||
| - **CMS editorial dashboards** — show live readability scores as editors write content | ||
| - **SaaS marketing sites** — gate content publication behind a minimum readability threshold | ||
| - **Blog and content pipelines** — CI check that fails when content is too complex | ||
| - **E-commerce product descriptions** — ensure product copy is accessible to your target audience | ||
| - **Educational platforms** — match content reading level to target student grade | ||
| - **Next.js / Remix apps** — score content server-side per route and expose scores in admin dashboards | ||
| --- | ||
| ## Contributing | ||
| ## Architecture Overview | ||
| - Issues: [github.com/cybercraftbd/power-seo/issues](https://github.com/cybercraftbd/power-seo/issues) | ||
| - PRs: [github.com/cybercraftbd/power-seo/pulls](https://github.com/cybercraftbd/power-seo/pulls) | ||
| - Development setup: | ||
| 1. `pnpm i` | ||
| 2. `pnpm build` | ||
| 3. `pnpm test` | ||
| - **Pure TypeScript** — no compiled binary, no native modules | ||
| - **Zero runtime dependencies** — pure computation; no NLP libraries, no external tools | ||
| - **Framework-agnostic** — works in any JavaScript environment with no DOM requirement | ||
| - **SSR compatible** — safe to run in Next.js Server Components, Remix loaders, or Express handlers | ||
| - **Edge runtime safe** — no Node.js-specific APIs; runs in Cloudflare Workers, Vercel Edge, Deno | ||
| - **HTML stripping** — uses a string-based tag removal loop (no regex ReDoS risk) | ||
| - **Tree-shakeable** — `"sideEffects": false` with named exports per algorithm function | ||
| - **Dual ESM + CJS** — ships both formats via tsup for any bundler or `require()` usage | ||
| **Release workflow** | ||
| --- | ||
| ```bash | ||
| npm version patch|minor|major | ||
| npm run build | ||
| npm publish --access public | ||
| ``` | ||
| ## Supply Chain Security | ||
| - No install scripts (`postinstall`, `preinstall`) | ||
| - No runtime network access | ||
| - No `eval` or dynamic code execution | ||
| - npm provenance enabled — every release is signed via Sigstore through GitHub Actions | ||
| - CI-signed builds — all releases published via verified `github.com/CyberCraftBD/power-seo` workflow | ||
| - Safe for SSR, Edge, and server environments | ||
| --- | ||
| ## About [CyberCraft Bangladesh](https://ccbd.dev) | ||
| ## The [@power-seo](https://www.npmjs.com/org/power-seo) Ecosystem | ||
| **[CyberCraft Bangladesh](https://ccbd.dev)** is a Bangladesh-based enterprise-grade software engineering company specializing in ERP system development, AI-powered SaaS and business applications, full-stack SEO services, custom website development, and scalable eCommerce platforms. We design and develop intelligent, automation-driven SaaS and enterprise solutions that help startups, SMEs, NGOs, educational institutes, and large organizations streamline operations, enhance digital visibility, and accelerate growth through modern cloud-native technologies. | ||
| All 17 packages are independently installable — use only what you need. | ||
| | | | | ||
| | -------------------- | -------------------------------------------------------------- | | ||
| | **Website** | [ccbd.dev](https://ccbd.dev) | | ||
| | **GitHub** | [github.com/cybercraftbd](https://github.com/cybercraftbd) | | ||
| | **npm Organization** | [npmjs.com/org/power-seo](https://www.npmjs.com/org/power-seo) | | ||
| | **Email** | [info@ccbd.dev](mailto:info@ccbd.dev) | | ||
| | Package | Install | Description | | ||
| | ------------------------------------------------------------------------------------------ | ----------------------------------- | ----------------------------------------------------------------------- | | ||
| | [`@power-seo/core`](https://www.npmjs.com/package/@power-seo/core) | `npm i @power-seo/core` | Framework-agnostic utilities, types, validators, and constants | | ||
| | [`@power-seo/react`](https://www.npmjs.com/package/@power-seo/react) | `npm i @power-seo/react` | React SEO components — meta, Open Graph, Twitter Card, breadcrumbs | | ||
| | [`@power-seo/meta`](https://www.npmjs.com/package/@power-seo/meta) | `npm i @power-seo/meta` | SSR meta helpers for Next.js App Router, Remix v2, and generic SSR | | ||
| | [`@power-seo/schema`](https://www.npmjs.com/package/@power-seo/schema) | `npm i @power-seo/schema` | Type-safe JSON-LD structured data — 23 builders + 21 React components | | ||
| | [`@power-seo/content-analysis`](https://www.npmjs.com/package/@power-seo/content-analysis) | `npm i @power-seo/content-analysis` | Yoast-style SEO content scoring engine with React components | | ||
| | [`@power-seo/readability`](https://www.npmjs.com/package/@power-seo/readability) | `npm i @power-seo/readability` | Readability scoring — Flesch-Kincaid, Gunning Fog, Coleman-Liau, ARI | | ||
| | [`@power-seo/preview`](https://www.npmjs.com/package/@power-seo/preview) | `npm i @power-seo/preview` | SERP, Open Graph, and Twitter/X Card preview generators | | ||
| | [`@power-seo/sitemap`](https://www.npmjs.com/package/@power-seo/sitemap) | `npm i @power-seo/sitemap` | XML sitemap generation, streaming, index splitting, and validation | | ||
| | [`@power-seo/redirects`](https://www.npmjs.com/package/@power-seo/redirects) | `npm i @power-seo/redirects` | Redirect engine with Next.js, Remix, and Express adapters | | ||
| | [`@power-seo/links`](https://www.npmjs.com/package/@power-seo/links) | `npm i @power-seo/links` | Link graph analysis — orphan detection, suggestions, equity scoring | | ||
| | [`@power-seo/audit`](https://www.npmjs.com/package/@power-seo/audit) | `npm i @power-seo/audit` | Full SEO audit engine — meta, content, structure, performance rules | | ||
| | [`@power-seo/images`](https://www.npmjs.com/package/@power-seo/images) | `npm i @power-seo/images` | Image SEO — alt text, lazy loading, format analysis, image sitemaps | | ||
| | [`@power-seo/ai`](https://www.npmjs.com/package/@power-seo/ai) | `npm i @power-seo/ai` | LLM-agnostic AI prompt templates and parsers for SEO tasks | | ||
| | [`@power-seo/analytics`](https://www.npmjs.com/package/@power-seo/analytics) | `npm i @power-seo/analytics` | Merge GSC + audit data, trend analysis, ranking insights, dashboard | | ||
| | [`@power-seo/search-console`](https://www.npmjs.com/package/@power-seo/search-console) | `npm i @power-seo/search-console` | Google Search Console API — OAuth2, service account, URL inspection | | ||
| | [`@power-seo/integrations`](https://www.npmjs.com/package/@power-seo/integrations) | `npm i @power-seo/integrations` | Semrush and Ahrefs API clients with rate limiting and pagination | | ||
| | [`@power-seo/tracking`](https://www.npmjs.com/package/@power-seo/tracking) | `npm i @power-seo/tracking` | GA4, Clarity, PostHog, Plausible, Fathom — scripts + consent management | | ||
| © 2026 [CyberCraft Bangladesh](https://ccbd.dev) · Released under the [MIT License](../../LICENSE) | ||
| --- | ||
| ## License | ||
| ## Keywords | ||
| MIT | ||
| readability score typescript · flesch kincaid typescript · gunning fog index · coleman liau index · automated readability index · flesch reading ease · content readability npm · text readability score · readability checker nodejs · seo readability · content scoring typescript · readability api · programmatic readability · ci readability check · cms readability · content quality typescript · seo content scoring · multi-algorithm readability · status labels readability · zero dependency readability | ||
| --- | ||
| ## Keywords | ||
| ## About [CyberCraft Bangladesh](https://ccbd.dev) | ||
| ```text | ||
| seo, readability, flesch-kincaid, gunning-fog, coleman-liau, ari, automated-readability-index, | ||
| reading-ease, content-scoring, text-analysis, typescript, nodejs, content-seo, editorial-tools | ||
| ``` | ||
| **[CyberCraft Bangladesh](https://ccbd.dev)** is a Bangladesh-based enterprise-grade software development and Full Stack SEO service provider company specializing in ERP system development, AI-powered SaaS and business applications, full-stack SEO services, custom website development, and scalable eCommerce platforms. We design and develop intelligent, automation-driven SaaS and enterprise solutions that help startups, SMEs, NGOs, educational institutes, and large organizations streamline operations, enhance digital visibility, and accelerate growth through modern cloud-native technologies. | ||
| [](https://ccbd.dev) | ||
| [](https://github.com/cybercraftbd) | ||
| [](https://www.npmjs.com/org/power-seo) | ||
| [](mailto:info@ccbd.dev) | ||
| © 2026 [CyberCraft Bangladesh](https://ccbd.dev) · Released under the [MIT License](../../LICENSE) |
100348
0.49%9
12.5%330
-16.24%+ Added
Updated