ckmtools / textlens / vs text-readability

TextLens vs text-readability

Both packages score readability. TextLens goes further — sentiment analysis, keyword extraction, SEO scoring, and a CLI, all with zero dependencies.

$ npm install textlens

Side-by-side comparison

Feature TextLens text-readability
npm weekly downloads ~500 ~16,000
Dependencies Zero 5 (syllable, etc.)
TypeScript Native (written in TS) — JS only
Readability formulas 8 + consensus grade 7 (no Linsear Write, no consensus)
Flesch-Kincaid
Gunning Fog
SMOG
Coleman-Liau
ARI
Dale-Chall
Linsear Write
Consensus grade ✓ (avg of all)
Sentiment analysis ✓ AFINN-165
Keyword extraction ✓ TF-IDF
SEO scoring
Reading time
CLI
Browser support ✓ (no Node deps) Partial (has Node deps)
Single function call ✓ analyze() — separate functions
Bundle size ~45 KB ~150 KB+ with deps
License MIT MIT

What TextLens adds over text-readability

text-readability covers basic readability scoring. TextLens matches those formulas and adds an entire analysis toolkit on top.

Consensus grade

Averages all 8 readability formulas into one grade level. No more picking which formula to trust — get a single number that represents all of them.

AFINN-165 sentiment analysis

Lexicon-based sentiment scoring with confidence values and word-level breakdown. Know whether your content reads positive, negative, or neutral.

TF-IDF keyword extraction

Ranked keywords with density analysis for unigrams, bigrams, and trigrams. Understand what your text is actually about.

SEO content scoring

Content quality score (A–F grade) with actionable suggestions. Check keyword density, heading structure, and readability in one call.

Built-in CLI

Analyze files or piped input from your terminal. text-readability is library-only — TextLens works from the command line too.

Zero dependencies

text-readability pulls in 5 dependencies (syllable, etc.). TextLens ships nothing extra — smaller install, no supply chain risk.

Native TypeScript

Written in TypeScript with full type definitions. text-readability is plain JavaScript with no type support.

Works in the browser

No Node.js-specific dependencies means TextLens runs in any browser environment without polyfills or bundler workarounds.

Code comparison

text-readability requires a separate function call for each formula. TextLens returns everything in one call.

TextLens TypeScript

import { analyze } from 'textlens';

const result = analyze(text);

result.readability.fleschKincaidGrade;  // 8.2
result.readability.gunningFogIndex;     // 10.1
result.readability.consensusGrade;      // 8.7
result.sentiment.label;                 // 'positive'
result.keywords;                        // ['readability', ...]
result.seo.score;                       // 82

text-readability JavaScript

const rs = require('text-readability');

rs.fleschReadingEase(text);             // 65.2
rs.fleschKincaidGrade(text);            // 8.2
rs.gunningFog(text);                    // 10.1
rs.smogIndex(text);                     // 9.8
rs.colemanLiauIndex(text);              // 8.5
rs.automatedReadabilityIndex(text);     // 8.9

// no consensus grade
// no sentiment analysis
// no keyword extraction
// no SEO scoring
// no CLI

When to use each

Use TextLens if you want more than readability scores TextLens gives you readability + sentiment + keywords + SEO in one package. One function call, zero dependencies, full TypeScript types, and a CLI for terminal use.
Use TextLens for browser-side analysis Zero dependencies means TextLens works in any browser without polyfills. Build client-side writing tools or CMS plugins. text-readability's dependency chain makes browser use harder.
Use TextLens if supply chain matters Zero dependencies means zero transitive risk. text-readability pulls in 5 packages. For security-conscious projects, fewer dependencies means less surface area.
Use text-readability if you only need basic readability scores text-readability is a mature, established package with 16K weekly downloads. If you only need Flesch-Kincaid and Gunning Fog scores and don't need sentiment, keywords, or SEO, it does the job.

Get started

$ npm install textlens