diff --git a/seo-crawl-audit.mjs b/seo-crawl-audit.mjs index f623e1c..6a455d1 100644 --- a/seo-crawl-audit.mjs +++ b/seo-crawl-audit.mjs @@ -1,5 +1,5 @@ // Full dist/ crawl audit: link graph, orphans, depth, metas, schema, broken links -import { readdirSync, readFileSync, existsSync } from 'node:fs'; +import { readdirSync, readFileSync, existsSync, promises as fsPromises } from 'node:fs'; import { join, relative } from 'node:path'; const DIST = 'dist'; @@ -28,9 +28,9 @@ const norm = (href) => { return href; }; -for (const f of files) { +const fileData = await Promise.all(files.map(async (f) => { const rel = '/' + relative(DIST, f).replace(/index\.html$/, '').replace(/\.html$/, '/'); - const html = readFileSync(f, 'utf8'); + const html = await fsPromises.readFile(f, 'utf8'); const title = (html.match(/