@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 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
- # Temporary Holding Version
1
+ # @seostudio/audit-engine
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
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.