@seostudio/audit-engine 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +57 -2
- package/dist/amp-validator.generated-HCTPRNDJ.js +4 -0
- package/dist/chunk-6QPF6O7D.js +197 -0
- package/dist/chunk-7SGWGESF.js +1753 -0
- package/dist/chunk-J4ZNQFJO.js +733 -0
- package/dist/chunk-XTLRDZOD.js +10238 -0
- package/dist/en-gb.generated-SZLUKHIP.js +7 -0
- package/dist/en-us.generated-H6EP75K6.js +7 -0
- package/dist/es.generated-SYEDFESZ.js +7 -0
- package/dist/facts.d.ts +1165 -0
- package/dist/facts.js +1 -0
- package/dist/fr.generated-CQZWZDYQ.js +7 -0
- package/dist/host-gate.d.ts +68 -0
- package/dist/host-gate.js +1 -0
- package/dist/index.d.ts +269 -0
- package/dist/index.js +9314 -0
- package/dist/nl.generated-MW64BR3F.js +7 -0
- package/dist/reading.d.ts +517 -0
- package/dist/reading.js +3 -0
- package/dist/resource-check.d.ts +131 -0
- package/dist/resource-check.js +3 -0
- package/dist/types.d.ts +370 -0
- package/dist/types.js +1 -0
- package/package.json +69 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Digital Front LLP
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,3 +1,58 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @seostudio/audit-engine
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The site audit engine behind [SEOStudio](https://seostudio.com): a polite crawler and the audit's
|
|
4
|
+
checks, in TypeScript, with no database and no account. MIT licensed.
|
|
5
|
+
|
|
6
|
+
It reads a site the way a search engine does: robots.txt and the sitemaps first, then every page it
|
|
7
|
+
can reach from the home page, then what those pages load and link out to. Every check files a stable
|
|
8
|
+
rule id (`title_missing`, `broken_internal_links`, `redirect_chain`...) with its evidence as data, so
|
|
9
|
+
you can store, compare or word the results as you like.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @seostudio/audit-engine
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
It is an ES module with its own types, for Node.js 22.19 or later. For the command line, use the
|
|
18
|
+
[`seostudio` CLI](https://github.com/DigitalFrontLLP/SEOStudio/tree/main/packages/cli) instead: `npx seostudio audit example.com`.
|
|
19
|
+
|
|
20
|
+
## Crawl a site
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { crawlSite, renderHtmlReport, toCsv } from "@seostudio/audit-engine";
|
|
24
|
+
import { writeFile } from "node:fs/promises";
|
|
25
|
+
|
|
26
|
+
const report = await crawlSite({
|
|
27
|
+
url: "https://example.com/",
|
|
28
|
+
maxPages: 200,
|
|
29
|
+
onProgress: (progress) => console.log(progress.phase, progress.pagesRead)
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
console.log(report.summary.score, report.summary.bySeverity);
|
|
33
|
+
await writeFile("audit.html", renderHtmlReport(report));
|
|
34
|
+
await writeFile("audit.csv", toCsv(report));
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`crawlSite` runs every check that needs no paid data or account data. The checks that join Google
|
|
38
|
+
Search Console, Analytics or lab tests stay quiet without that data.
|
|
39
|
+
|
|
40
|
+
## The report
|
|
41
|
+
|
|
42
|
+
`AuditReport` is plain JSON, versioned by `schemaVersion` (now `1`):
|
|
43
|
+
|
|
44
|
+
- `pages`: every page read, with its status, title, click depth and issue count;
|
|
45
|
+
- `issues`: every finding, with its `ruleId`, `severity` (`critical`, `warning` or `notice`),
|
|
46
|
+
`category`, `kind` (`issue` or `tip`), `page` and `evidence`;
|
|
47
|
+
- `summary`: the counts by severity and rule, and the site's health score (0 to 100).
|
|
48
|
+
|
|
49
|
+
## Read one page
|
|
50
|
+
|
|
51
|
+
`readPage(url, options)` makes one page's reading exactly as the SEOStudio desktop app does, so a
|
|
52
|
+
client can fetch a page from its own address and send the reading to a server that judges it.
|
|
53
|
+
|
|
54
|
+
## The crawler
|
|
55
|
+
|
|
56
|
+
The crawler obeys robots.txt (its own group, `SiteSnapshot`, then `*`), keeps to the site's
|
|
57
|
+
`Crawl-delay` (one second between requests at least), backs off when a site answers 429 or 503, and
|
|
58
|
+
never follows a URL that looks like a crawl trap.
|