@power-seo/content-analysis 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -78
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -20,18 +20,18 @@ Keyword-focused content analysis with real-time scoring, readability checks, and
|
|
|
20
20
|
|
|
21
21
|
## Why @power-seo/content-analysis?
|
|
22
22
|
|
|
23
|
-
|
|
|
24
|
-
|
|
25
|
-
| Keyphrase check
|
|
26
|
-
| Title validation
|
|
27
|
-
| Meta description
|
|
28
|
-
| Heading structure | ❌ Missed H1s
|
|
29
|
-
| Image alt text
|
|
30
|
-
| Link analysis
|
|
31
|
-
| SEO score
|
|
32
|
-
| Framework support | ❌ WordPress-only | ✅ Next.js, Remix, Vite, Node.js, Edge
|
|
33
|
-
|
|
34
|
-
 + keyphrase |
|
|
28
|
+
| Heading structure | ❌ Missed H1s | ✅ H1 hierarchy + keyphrase in subheadings |
|
|
29
|
+
| Image alt text | ❌ Skipped | ✅ Alt presence + keyphrase in alt |
|
|
30
|
+
| Link analysis | ❌ Unknown | ✅ Internal + external link presence |
|
|
31
|
+
| SEO score | ❌ Guesswork | ✅ Aggregate score with per-check breakdown |
|
|
32
|
+
| Framework support | ❌ WordPress-only | ✅ Next.js, Remix, Vite, Node.js, Edge |
|
|
33
|
+
|
|
34
|
+

|
|
35
35
|
|
|
36
36
|
---
|
|
37
37
|
|
|
@@ -52,7 +52,7 @@ Keyword-focused content analysis with real-time scoring, readability checks, and
|
|
|
52
52
|
- **Full TypeScript support** — complete type definitions for all inputs, outputs, and check IDs
|
|
53
53
|
- **Tree-shakeable** — import only the checks you use; zero dead code in your bundle
|
|
54
54
|
|
|
55
|
-

|
|
56
56
|
|
|
57
57
|
---
|
|
58
58
|
|
|
@@ -60,22 +60,22 @@ Keyword-focused content analysis with real-time scoring, readability checks, and
|
|
|
60
60
|
|
|
61
61
|
| Feature | @power-seo/content-analysis | Yoast SEO | next-seo | seo-analyzer | react-helmet |
|
|
62
62
|
| ------------------------------ | :-------------------------: | :-------: | :------: | :----------: | :----------: |
|
|
63
|
-
| Keyphrase density check |
|
|
64
|
-
| Keyphrase distribution |
|
|
65
|
-
| Title + meta validation |
|
|
66
|
-
| Heading structure check |
|
|
67
|
-
| Image alt + keyphrase check |
|
|
68
|
-
| Internal / external link check |
|
|
69
|
-
| Aggregate SEO score |
|
|
70
|
-
| Per-check disable config |
|
|
71
|
-
| Works outside WordPress |
|
|
72
|
-
| TypeScript-first |
|
|
73
|
-
| Tree-shakeable |
|
|
74
|
-
| React UI components |
|
|
75
|
-
| CI / Node.js usage |
|
|
76
|
-
| Zero runtime dependencies |
|
|
77
|
-
|
|
78
|
-

|
|
79
79
|
|
|
80
80
|
---
|
|
81
81
|
|
|
@@ -107,15 +107,16 @@ const result = analyzeContent({
|
|
|
107
107
|
content: '<h1>Best Running Shoes</h1><p>Finding the right running shoes...</p>',
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
-
console.log(result.score);
|
|
111
|
-
console.log(result.maxScore);
|
|
110
|
+
console.log(result.score); // e.g. 38
|
|
111
|
+
console.log(result.maxScore); // e.g. 55
|
|
112
112
|
console.log(result.results);
|
|
113
113
|
// [{ id: 'title-presence', status: 'good', description: '...', score: 5, maxScore: 5 }, ...]
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
-

|
|
117
117
|
|
|
118
118
|
**Status thresholds (per check):**
|
|
119
|
+
|
|
119
120
|
- `good` — check fully passes
|
|
120
121
|
- `ok` — check partially passes
|
|
121
122
|
- `poor` — check fails
|
|
@@ -133,7 +134,8 @@ import { analyzeContent } from '@power-seo/content-analysis';
|
|
|
133
134
|
|
|
134
135
|
const output = analyzeContent({
|
|
135
136
|
title: 'Next.js SEO Best Practices',
|
|
136
|
-
metaDescription:
|
|
137
|
+
metaDescription:
|
|
138
|
+
'Learn how to optimize your Next.js app for search engines with meta tags and structured data.',
|
|
137
139
|
focusKeyphrase: 'next.js seo',
|
|
138
140
|
content: htmlString,
|
|
139
141
|
images: imageList,
|
|
@@ -237,10 +239,10 @@ if (failures.length > 0) {
|
|
|
237
239
|
|
|
238
240
|
### Entry Points
|
|
239
241
|
|
|
240
|
-
| Import
|
|
241
|
-
|
|
|
242
|
-
| `@power-seo/content-analysis`
|
|
243
|
-
| `@power-seo/content-analysis/react` | React components for analysis UI
|
|
242
|
+
| Import | Description |
|
|
243
|
+
| ----------------------------------- | -------------------------------------------- |
|
|
244
|
+
| `@power-seo/content-analysis` | Core analyzer and individual check functions |
|
|
245
|
+
| `@power-seo/content-analysis/react` | React components for analysis UI |
|
|
244
246
|
|
|
245
247
|
### `analyzeContent()`
|
|
246
248
|
|
|
@@ -253,36 +255,36 @@ function analyzeContent(
|
|
|
253
255
|
|
|
254
256
|
#### `ContentAnalysisInput`
|
|
255
257
|
|
|
256
|
-
| Prop | Type | Required | Description
|
|
257
|
-
| ----------------- | -------------------------------------- | -------- |
|
|
258
|
-
| `content` | `string` | ✅ | Body HTML string
|
|
259
|
-
| `title` | `string` | — | Page `<title>` content
|
|
260
|
-
| `metaDescription` | `string` | — | Meta description content
|
|
261
|
-
| `focusKeyphrase` | `string` | — | Focus keyphrase to analyze against
|
|
262
|
-
| `slug` | `string` | — | URL slug (used for keyphrase-in-slug check)
|
|
263
|
-
| `images` | `Array<{ src: string; alt?: string }>` | — | Images found on the page
|
|
264
|
-
| `internalLinks` | `string[]` | — | Internal link URLs
|
|
265
|
-
| `externalLinks` | `string[]` | — | External link URLs
|
|
258
|
+
| Prop | Type | Required | Description |
|
|
259
|
+
| ----------------- | -------------------------------------- | -------- | ------------------------------------------- |
|
|
260
|
+
| `content` | `string` | ✅ | Body HTML string |
|
|
261
|
+
| `title` | `string` | — | Page `<title>` content |
|
|
262
|
+
| `metaDescription` | `string` | — | Meta description content |
|
|
263
|
+
| `focusKeyphrase` | `string` | — | Focus keyphrase to analyze against |
|
|
264
|
+
| `slug` | `string` | — | URL slug (used for keyphrase-in-slug check) |
|
|
265
|
+
| `images` | `Array<{ src: string; alt?: string }>` | — | Images found on the page |
|
|
266
|
+
| `internalLinks` | `string[]` | — | Internal link URLs |
|
|
267
|
+
| `externalLinks` | `string[]` | — | External link URLs |
|
|
266
268
|
|
|
267
269
|
#### `ContentAnalysisOutput`
|
|
268
270
|
|
|
269
|
-
| Field | Type | Description
|
|
270
|
-
| ----------------- | ------------------ |
|
|
271
|
-
| `score` | `number` | Sum of all individual check scores
|
|
272
|
-
| `maxScore` | `number` | Maximum possible score (varies by enabled checks)
|
|
273
|
-
| `results` | `AnalysisResult[]` | Per-check results
|
|
274
|
-
| `recommendations` | `string[]` | Descriptions from all failed or partial checks
|
|
271
|
+
| Field | Type | Description |
|
|
272
|
+
| ----------------- | ------------------ | ------------------------------------------------- |
|
|
273
|
+
| `score` | `number` | Sum of all individual check scores |
|
|
274
|
+
| `maxScore` | `number` | Maximum possible score (varies by enabled checks) |
|
|
275
|
+
| `results` | `AnalysisResult[]` | Per-check results |
|
|
276
|
+
| `recommendations` | `string[]` | Descriptions from all failed or partial checks |
|
|
275
277
|
|
|
276
278
|
#### `AnalysisResult`
|
|
277
279
|
|
|
278
|
-
| Field | Type | Description
|
|
279
|
-
| ------------- | ---------------- |
|
|
280
|
-
| `id` | `string` | Unique check identifier (one of the `CheckId` values)
|
|
281
|
-
| `title` | `string` | Short display label for the check (e.g. `"SEO title"`)
|
|
282
|
-
| `description` | `string` | Human-readable actionable feedback
|
|
283
|
-
| `status` | `AnalysisStatus` | `'good'` \| `'ok'` \| `'poor'`
|
|
284
|
-
| `score` | `number` | Points earned for this check
|
|
285
|
-
| `maxScore` | `number` | Maximum points for this check
|
|
280
|
+
| Field | Type | Description |
|
|
281
|
+
| ------------- | ---------------- | ------------------------------------------------------ |
|
|
282
|
+
| `id` | `string` | Unique check identifier (one of the `CheckId` values) |
|
|
283
|
+
| `title` | `string` | Short display label for the check (e.g. `"SEO title"`) |
|
|
284
|
+
| `description` | `string` | Human-readable actionable feedback |
|
|
285
|
+
| `status` | `AnalysisStatus` | `'good'` \| `'ok'` \| `'poor'` |
|
|
286
|
+
| `score` | `number` | Points earned for this check |
|
|
287
|
+
| `maxScore` | `number` | Maximum points for this check |
|
|
286
288
|
|
|
287
289
|
#### `AnalysisConfig`
|
|
288
290
|
|
|
@@ -292,27 +294,27 @@ function analyzeContent(
|
|
|
292
294
|
|
|
293
295
|
### Individual Check Functions
|
|
294
296
|
|
|
295
|
-
| Function | Check ID(s)
|
|
296
|
-
| ----------------------------- |
|
|
297
|
-
| `checkTitle(input)` | `title-presence`, `title-keyphrase`
|
|
298
|
-
| `checkMetaDescription(input)` | `meta-description-presence`, `meta-description-keyphrase`
|
|
299
|
-
| `checkKeyphraseUsage(input)` | `keyphrase-density`, `keyphrase-distribution`
|
|
300
|
-
| `checkHeadings(input)` | `heading-structure`, `heading-keyphrase`
|
|
301
|
-
| `checkWordCount(input)` | `word-count`
|
|
302
|
-
| `checkImages(input)` | `image-alt`, `image-keyphrase`
|
|
303
|
-
| `checkLinks(input)` | `internal-links`, `external-links`
|
|
297
|
+
| Function | Check ID(s) | Checks For |
|
|
298
|
+
| ----------------------------- | --------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
299
|
+
| `checkTitle(input)` | `title-presence`, `title-keyphrase` | Title presence **and** length (50–60 chars, validated inside `title-presence`), keyphrase |
|
|
300
|
+
| `checkMetaDescription(input)` | `meta-description-presence`, `meta-description-keyphrase` | Description presence, length (120–160 chars), keyphrase |
|
|
301
|
+
| `checkKeyphraseUsage(input)` | `keyphrase-density`, `keyphrase-distribution` | Density (0.5–2.5%) and occurrence in key areas |
|
|
302
|
+
| `checkHeadings(input)` | `heading-structure`, `heading-keyphrase` | H1 presence, hierarchy, keyphrase in subheadings |
|
|
303
|
+
| `checkWordCount(input)` | `word-count` | Min 300 words (good at 1,000+) |
|
|
304
|
+
| `checkImages(input)` | `image-alt`, `image-keyphrase` | Alt text presence and keyphrase in alt |
|
|
305
|
+
| `checkLinks(input)` | `internal-links`, `external-links` | Internal and external link presence |
|
|
304
306
|
|
|
305
307
|
> **Note:** There is no separate `title-length` check ID. Title length validation (50–60 chars) is evaluated inside the `title-presence` check — a title that exists but is outside the recommended range returns `status: 'ok'` rather than `'good'`.
|
|
306
308
|
|
|
307
309
|
### Types
|
|
308
310
|
|
|
309
|
-
| Type | Description
|
|
310
|
-
| ----------------------- |
|
|
311
|
-
| `CheckId` | Union of all 13 built-in check IDs
|
|
312
|
-
| `AnalysisConfig` | `{ disabledChecks?: CheckId[] }`
|
|
313
|
-
| `AnalysisStatus` | `'good' \| 'ok' \| 'poor'`
|
|
314
|
-
| `ContentAnalysisInput` | Input shape for `analyzeContent()`
|
|
315
|
-
| `ContentAnalysisOutput` | Output shape from `analyzeContent()`
|
|
311
|
+
| Type | Description |
|
|
312
|
+
| ----------------------- | ------------------------------------------------------------------------ |
|
|
313
|
+
| `CheckId` | Union of all 13 built-in check IDs |
|
|
314
|
+
| `AnalysisConfig` | `{ disabledChecks?: CheckId[] }` |
|
|
315
|
+
| `AnalysisStatus` | `'good' \| 'ok' \| 'poor'` |
|
|
316
|
+
| `ContentAnalysisInput` | Input shape for `analyzeContent()` |
|
|
317
|
+
| `ContentAnalysisOutput` | Output shape from `analyzeContent()` |
|
|
316
318
|
| `AnalysisResult` | Single check result with id, title, description, status, score, maxScore |
|
|
317
319
|
|
|
318
320
|
---
|
|
@@ -360,7 +362,7 @@ All 17 packages are independently installable — use only what you need.
|
|
|
360
362
|
| [`@power-seo/core`](https://www.npmjs.com/package/@power-seo/core) | `npm i @power-seo/core` | Framework-agnostic utilities, types, validators, and constants |
|
|
361
363
|
| [`@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 |
|
|
362
364
|
| [`@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 |
|
|
363
|
-
| [`@power-seo/schema`](https://www.npmjs.com/package/@power-seo/schema) | `npm i @power-seo/schema` | Type-safe JSON-LD structured data —
|
|
365
|
+
| [`@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 |
|
|
364
366
|
| [`@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 |
|
|
365
367
|
| [`@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 |
|
|
366
368
|
| [`@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 |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@power-seo/content-analysis",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Yoast-style SEO content analysis engine with scoring, checks, and React components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@power-seo/core": "1.0.
|
|
26
|
+
"@power-seo/core": "1.0.10"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"react": "^18.0.0 || ^19.0.0"
|