@power-seo/content-analysis 1.0.8 → 1.0.9
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 +73 -71
- package/package.json +13 -13
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -20,16 +20,16 @@ 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
|
|
23
|
+
| | Without | With |
|
|
24
|
+
| ----------------- | ----------------- | ------------------------------------------- |
|
|
25
|
+
| Keyphrase check | ❌ Manual grep | ✅ Density + distribution scoring |
|
|
26
|
+
| Title validation | ❌ Eye-check only | ✅ Presence, length, keyphrase match |
|
|
27
|
+
| Meta description | ❌ Unchecked | ✅ Length (120–160 chars) + 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
33
|
|
|
34
34
|

|
|
35
35
|
|
|
@@ -60,20 +60,20 @@ 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 |
|
|
63
|
+
| Keyphrase density check | ✅ | ✅ | ❌ | Partial | ❌ |
|
|
64
|
+
| Keyphrase distribution | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
65
|
+
| Title + meta validation | ✅ | ✅ | ❌ | Partial | ❌ |
|
|
66
|
+
| Heading structure check | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
67
|
+
| Image alt + keyphrase check | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
68
|
+
| Internal / external link check | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
69
|
+
| Aggregate SEO score | ✅ | ✅ | ❌ | Partial | ❌ |
|
|
70
|
+
| Per-check disable config | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
71
|
+
| Works outside WordPress | ✅ | ❌ | ✅ | ✅ | ✅ |
|
|
72
|
+
| TypeScript-first | ✅ | ❌ | Partial | ❌ | ❌ |
|
|
73
|
+
| Tree-shakeable | ✅ | ❌ | Partial | ❌ | ❌ |
|
|
74
|
+
| React UI components | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
75
|
+
| CI / Node.js usage | ✅ | ❌ | ❌ | ✅ | ❌ |
|
|
76
|
+
| Zero runtime dependencies | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
77
77
|
|
|
78
78
|

|
|
79
79
|
|
|
@@ -107,8 +107,8 @@ 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
|
```
|
|
@@ -116,6 +116,7 @@ console.log(result.results);
|
|
|
116
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
|
---
|
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.9",
|
|
4
4
|
"description": "Yoast-style SEO content analysis engine with scoring, checks, and React components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -22,8 +22,18 @@
|
|
|
22
22
|
"files": [
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsup",
|
|
27
|
+
"dev": "tsup --watch",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"test:watch": "vitest",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"lint": "eslint src/",
|
|
32
|
+
"lint:fix": "eslint src/ --fix",
|
|
33
|
+
"clean": "rimraf dist"
|
|
34
|
+
},
|
|
25
35
|
"dependencies": {
|
|
26
|
-
"@power-seo/core": "
|
|
36
|
+
"@power-seo/core": "workspace:*"
|
|
27
37
|
},
|
|
28
38
|
"peerDependencies": {
|
|
29
39
|
"react": "^18.0.0 || ^19.0.0"
|
|
@@ -83,15 +93,5 @@
|
|
|
83
93
|
"funding": {
|
|
84
94
|
"type": "github",
|
|
85
95
|
"url": "https://github.com/sponsors/cybercraftbd"
|
|
86
|
-
},
|
|
87
|
-
"scripts": {
|
|
88
|
-
"build": "tsup",
|
|
89
|
-
"dev": "tsup --watch",
|
|
90
|
-
"test": "vitest run",
|
|
91
|
-
"test:watch": "vitest",
|
|
92
|
-
"typecheck": "tsc --noEmit",
|
|
93
|
-
"lint": "eslint src/",
|
|
94
|
-
"lint:fix": "eslint src/ --fix",
|
|
95
|
-
"clean": "rimraf dist"
|
|
96
96
|
}
|
|
97
|
-
}
|
|
97
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 CCBD SEO Contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|