aiseo-audit 1.2.7 → 1.2.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 CHANGED
@@ -5,7 +5,7 @@
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-7EB6D7.svg)](https://opensource.org/licenses/MIT)
6
6
  [![Node.js](https://img.shields.io/badge/node-%3E%3D20-7EB6D7.svg)](https://nodejs.org)
7
7
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-7EB6D7?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
8
- [![Tests](https://img.shields.io/badge/tests-194%20passed-8FBC8F)](https://github.com/agencyenterprise/aiseo-audit)
8
+ [![Tests](https://img.shields.io/badge/tests-202%20passed-8FBC8F)](https://github.com/agencyenterprise/aiseo-audit)
9
9
  [![Coverage](https://img.shields.io/codecov/c/github/agencyenterprise/aiseo-audit?color=8FBC8F&label=coverage)](https://codecov.io/gh/agencyenterprise/aiseo-audit)
10
10
 
11
11
  <div align="center">
@@ -15,6 +15,9 @@
15
15
 
16
16
  Deterministic CLI that audits web pages for **AI search readiness**. Think Lighthouse, but for how well AI engines can fetch, extract, understand, and cite your content.
17
17
 
18
+ > [!TIP]
19
+ > Run `aiseo-audit https://www.aiseo-audit.com` to see an [A+ Score](https://www.aiseo-audit.com/)
20
+
18
21
  **AI SEO measures how reusable your content is for generative engines, not traditional search rankings.**
19
22
 
20
23
  - [Quick Start](#quick-start)
package/dist/cli.js CHANGED
@@ -27,7 +27,7 @@ var import_commander = require("commander");
27
27
 
28
28
  // src/modules/analyzer/constants.ts
29
29
  var DOMAIN_SIGNAL_TIMEOUT_CAP = 5e3;
30
- var VERSION = true ? "1.2.7" : "0.0.0";
30
+ var VERSION = true ? "1.2.9" : "0.0.0";
31
31
 
32
32
  // src/modules/fetcher/constants.ts
33
33
  var MAX_RESPONSE_SIZE = 10 * 1024 * 1024;
@@ -851,7 +851,7 @@ function auditContentExtractability(page, fetchResult, domainSignals) {
851
851
  )
852
852
  );
853
853
  const extractRatio = page.stats.rawByteLength > 0 ? page.stats.cleanTextLength / page.stats.rawByteLength : 0;
854
- const extractScore = extractRatio >= 0.05 && extractRatio <= 0.15 ? 12 : extractRatio >= 0.01 ? 8 : extractRatio > 0.15 ? 10 : 2;
854
+ const extractScore = extractRatio >= 0.05 && extractRatio <= 0.15 ? 12 : extractRatio > 0.15 ? 10 : extractRatio >= 0.01 ? 8 : 2;
855
855
  factors.push(
856
856
  makeFactor(
857
857
  "Text Extraction Quality",
@@ -876,7 +876,7 @@ function auditContentExtractability(page, fetchResult, domainSignals) {
876
876
  )
877
877
  );
878
878
  const wc = page.stats.wordCount;
879
- const wcScore = wc >= 300 && wc <= 3e3 ? 12 : wc >= 100 ? 8 : wc > 3e3 ? 10 : 2;
879
+ const wcScore = wc >= 300 && wc <= 3e3 ? 12 : wc > 3e3 ? 10 : wc >= 100 ? 8 : 2;
880
880
  factors.push(makeFactor("Word Count Adequacy", wcScore, 12, `${wc} words`));
881
881
  if (domainSignals) {
882
882
  const access2 = checkCrawlerAccess(domainSignals.robotsTxt);
@@ -1359,7 +1359,11 @@ function removeBoilerplate($) {
1359
1359
  function normalizeWhitespace(text) {
1360
1360
  return text.replace(/\s+/g, " ").trim();
1361
1361
  }
1362
+ var BLOCK_ELEMENTS = "p,div,td,th,li,h1,h2,h3,h4,h5,h6,dt,dd,br,blockquote,section,article";
1362
1363
  function extractCleanText($) {
1364
+ $(BLOCK_ELEMENTS).each((_, el) => {
1365
+ $(el).append(" ");
1366
+ });
1363
1367
  return normalizeWhitespace($("body").text());
1364
1368
  }
1365
1369
 
@@ -1368,7 +1372,9 @@ function extractPage(html, url) {
1368
1372
  const $ = cheerio.load(html);
1369
1373
  const title = $("title").text().trim() || $('meta[property="og:title"]').attr("content")?.trim() || "";
1370
1374
  const metaDescription = $('meta[name="description"]').attr("content")?.trim() || $('meta[property="og:description"]').attr("content")?.trim() || "";
1371
- const rawText = $("body").text().replace(/\s+/g, " ").trim();
1375
+ const $raw = cheerio.load(html);
1376
+ $raw("script, style, noscript").remove();
1377
+ const rawText = $raw("body").text().replace(/\s+/g, " ").trim();
1372
1378
  const rawByteLength = Buffer.byteLength(html, "utf-8");
1373
1379
  const h1Count = $("h1").length;
1374
1380
  const h2Count = $("h2").length;
package/dist/cli.mjs CHANGED
@@ -3,7 +3,7 @@ import { Command } from "commander";
3
3
 
4
4
  // src/modules/analyzer/constants.ts
5
5
  var DOMAIN_SIGNAL_TIMEOUT_CAP = 5e3;
6
- var VERSION = true ? "1.2.7" : "0.0.0";
6
+ var VERSION = true ? "1.2.9" : "0.0.0";
7
7
 
8
8
  // src/modules/fetcher/constants.ts
9
9
  var MAX_RESPONSE_SIZE = 10 * 1024 * 1024;
@@ -827,7 +827,7 @@ function auditContentExtractability(page, fetchResult, domainSignals) {
827
827
  )
828
828
  );
829
829
  const extractRatio = page.stats.rawByteLength > 0 ? page.stats.cleanTextLength / page.stats.rawByteLength : 0;
830
- const extractScore = extractRatio >= 0.05 && extractRatio <= 0.15 ? 12 : extractRatio >= 0.01 ? 8 : extractRatio > 0.15 ? 10 : 2;
830
+ const extractScore = extractRatio >= 0.05 && extractRatio <= 0.15 ? 12 : extractRatio > 0.15 ? 10 : extractRatio >= 0.01 ? 8 : 2;
831
831
  factors.push(
832
832
  makeFactor(
833
833
  "Text Extraction Quality",
@@ -852,7 +852,7 @@ function auditContentExtractability(page, fetchResult, domainSignals) {
852
852
  )
853
853
  );
854
854
  const wc = page.stats.wordCount;
855
- const wcScore = wc >= 300 && wc <= 3e3 ? 12 : wc >= 100 ? 8 : wc > 3e3 ? 10 : 2;
855
+ const wcScore = wc >= 300 && wc <= 3e3 ? 12 : wc > 3e3 ? 10 : wc >= 100 ? 8 : 2;
856
856
  factors.push(makeFactor("Word Count Adequacy", wcScore, 12, `${wc} words`));
857
857
  if (domainSignals) {
858
858
  const access2 = checkCrawlerAccess(domainSignals.robotsTxt);
@@ -1335,7 +1335,11 @@ function removeBoilerplate($) {
1335
1335
  function normalizeWhitespace(text) {
1336
1336
  return text.replace(/\s+/g, " ").trim();
1337
1337
  }
1338
+ var BLOCK_ELEMENTS = "p,div,td,th,li,h1,h2,h3,h4,h5,h6,dt,dd,br,blockquote,section,article";
1338
1339
  function extractCleanText($) {
1340
+ $(BLOCK_ELEMENTS).each((_, el) => {
1341
+ $(el).append(" ");
1342
+ });
1339
1343
  return normalizeWhitespace($("body").text());
1340
1344
  }
1341
1345
 
@@ -1344,7 +1348,9 @@ function extractPage(html, url) {
1344
1348
  const $ = cheerio.load(html);
1345
1349
  const title = $("title").text().trim() || $('meta[property="og:title"]').attr("content")?.trim() || "";
1346
1350
  const metaDescription = $('meta[name="description"]').attr("content")?.trim() || $('meta[property="og:description"]').attr("content")?.trim() || "";
1347
- const rawText = $("body").text().replace(/\s+/g, " ").trim();
1351
+ const $raw = cheerio.load(html);
1352
+ $raw("script, style, noscript").remove();
1353
+ const rawText = $raw("body").text().replace(/\s+/g, " ").trim();
1348
1354
  const rawByteLength = Buffer.byteLength(html, "utf-8");
1349
1355
  const h1Count = $("h1").length;
1350
1356
  const h2Count = $("h2").length;
package/dist/index.js CHANGED
@@ -849,7 +849,7 @@ function auditContentExtractability(page, fetchResult, domainSignals) {
849
849
  )
850
850
  );
851
851
  const extractRatio = page.stats.rawByteLength > 0 ? page.stats.cleanTextLength / page.stats.rawByteLength : 0;
852
- const extractScore = extractRatio >= 0.05 && extractRatio <= 0.15 ? 12 : extractRatio >= 0.01 ? 8 : extractRatio > 0.15 ? 10 : 2;
852
+ const extractScore = extractRatio >= 0.05 && extractRatio <= 0.15 ? 12 : extractRatio > 0.15 ? 10 : extractRatio >= 0.01 ? 8 : 2;
853
853
  factors.push(
854
854
  makeFactor(
855
855
  "Text Extraction Quality",
@@ -874,7 +874,7 @@ function auditContentExtractability(page, fetchResult, domainSignals) {
874
874
  )
875
875
  );
876
876
  const wc = page.stats.wordCount;
877
- const wcScore = wc >= 300 && wc <= 3e3 ? 12 : wc >= 100 ? 8 : wc > 3e3 ? 10 : 2;
877
+ const wcScore = wc >= 300 && wc <= 3e3 ? 12 : wc > 3e3 ? 10 : wc >= 100 ? 8 : 2;
878
878
  factors.push(makeFactor("Word Count Adequacy", wcScore, 12, `${wc} words`));
879
879
  if (domainSignals) {
880
880
  const access2 = checkCrawlerAccess(domainSignals.robotsTxt);
@@ -1357,7 +1357,11 @@ function removeBoilerplate($) {
1357
1357
  function normalizeWhitespace(text) {
1358
1358
  return text.replace(/\s+/g, " ").trim();
1359
1359
  }
1360
+ var BLOCK_ELEMENTS = "p,div,td,th,li,h1,h2,h3,h4,h5,h6,dt,dd,br,blockquote,section,article";
1360
1361
  function extractCleanText($) {
1362
+ $(BLOCK_ELEMENTS).each((_, el) => {
1363
+ $(el).append(" ");
1364
+ });
1361
1365
  return normalizeWhitespace($("body").text());
1362
1366
  }
1363
1367
 
@@ -1366,7 +1370,9 @@ function extractPage(html, url) {
1366
1370
  const $ = cheerio.load(html);
1367
1371
  const title = $("title").text().trim() || $('meta[property="og:title"]').attr("content")?.trim() || "";
1368
1372
  const metaDescription = $('meta[name="description"]').attr("content")?.trim() || $('meta[property="og:description"]').attr("content")?.trim() || "";
1369
- const rawText = $("body").text().replace(/\s+/g, " ").trim();
1373
+ const $raw = cheerio.load(html);
1374
+ $raw("script, style, noscript").remove();
1375
+ const rawText = $raw("body").text().replace(/\s+/g, " ").trim();
1370
1376
  const rawByteLength = Buffer.byteLength(html, "utf-8");
1371
1377
  const h1Count = $("h1").length;
1372
1378
  const h2Count = $("h2").length;
@@ -1440,7 +1446,7 @@ var import_zod = require("zod");
1440
1446
 
1441
1447
  // src/modules/analyzer/constants.ts
1442
1448
  var DOMAIN_SIGNAL_TIMEOUT_CAP = 5e3;
1443
- var VERSION = true ? "1.2.7" : "0.0.0";
1449
+ var VERSION = true ? "1.2.9" : "0.0.0";
1444
1450
 
1445
1451
  // src/modules/fetcher/schema.ts
1446
1452
  var FetchOptionsSchema = import_zod.z.object({
package/dist/index.mjs CHANGED
@@ -811,7 +811,7 @@ function auditContentExtractability(page, fetchResult, domainSignals) {
811
811
  )
812
812
  );
813
813
  const extractRatio = page.stats.rawByteLength > 0 ? page.stats.cleanTextLength / page.stats.rawByteLength : 0;
814
- const extractScore = extractRatio >= 0.05 && extractRatio <= 0.15 ? 12 : extractRatio >= 0.01 ? 8 : extractRatio > 0.15 ? 10 : 2;
814
+ const extractScore = extractRatio >= 0.05 && extractRatio <= 0.15 ? 12 : extractRatio > 0.15 ? 10 : extractRatio >= 0.01 ? 8 : 2;
815
815
  factors.push(
816
816
  makeFactor(
817
817
  "Text Extraction Quality",
@@ -836,7 +836,7 @@ function auditContentExtractability(page, fetchResult, domainSignals) {
836
836
  )
837
837
  );
838
838
  const wc = page.stats.wordCount;
839
- const wcScore = wc >= 300 && wc <= 3e3 ? 12 : wc >= 100 ? 8 : wc > 3e3 ? 10 : 2;
839
+ const wcScore = wc >= 300 && wc <= 3e3 ? 12 : wc > 3e3 ? 10 : wc >= 100 ? 8 : 2;
840
840
  factors.push(makeFactor("Word Count Adequacy", wcScore, 12, `${wc} words`));
841
841
  if (domainSignals) {
842
842
  const access2 = checkCrawlerAccess(domainSignals.robotsTxt);
@@ -1319,7 +1319,11 @@ function removeBoilerplate($) {
1319
1319
  function normalizeWhitespace(text) {
1320
1320
  return text.replace(/\s+/g, " ").trim();
1321
1321
  }
1322
+ var BLOCK_ELEMENTS = "p,div,td,th,li,h1,h2,h3,h4,h5,h6,dt,dd,br,blockquote,section,article";
1322
1323
  function extractCleanText($) {
1324
+ $(BLOCK_ELEMENTS).each((_, el) => {
1325
+ $(el).append(" ");
1326
+ });
1323
1327
  return normalizeWhitespace($("body").text());
1324
1328
  }
1325
1329
 
@@ -1328,7 +1332,9 @@ function extractPage(html, url) {
1328
1332
  const $ = cheerio.load(html);
1329
1333
  const title = $("title").text().trim() || $('meta[property="og:title"]').attr("content")?.trim() || "";
1330
1334
  const metaDescription = $('meta[name="description"]').attr("content")?.trim() || $('meta[property="og:description"]').attr("content")?.trim() || "";
1331
- const rawText = $("body").text().replace(/\s+/g, " ").trim();
1335
+ const $raw = cheerio.load(html);
1336
+ $raw("script, style, noscript").remove();
1337
+ const rawText = $raw("body").text().replace(/\s+/g, " ").trim();
1332
1338
  const rawByteLength = Buffer.byteLength(html, "utf-8");
1333
1339
  const h1Count = $("h1").length;
1334
1340
  const h2Count = $("h2").length;
@@ -1402,7 +1408,7 @@ import { z } from "zod";
1402
1408
 
1403
1409
  // src/modules/analyzer/constants.ts
1404
1410
  var DOMAIN_SIGNAL_TIMEOUT_CAP = 5e3;
1405
- var VERSION = true ? "1.2.7" : "0.0.0";
1411
+ var VERSION = true ? "1.2.9" : "0.0.0";
1406
1412
 
1407
1413
  // src/modules/fetcher/schema.ts
1408
1414
  var FetchOptionsSchema = z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiseo-audit",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
4
4
  "description": "Lighthouse for AI SEO. Audit any webpage for AI search readiness. 7 categories, 30+ factors, research-backed scoring. Deterministic, engine-agnostic, zero API keys.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",