{"_id":"@antjones315/lighthouse-scanner","name":"@antjones315/lighthouse-scanner","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@antjones315/lighthouse-scanner","version":"0.1.0","description":"Run a Google Lighthouse audit on any URL via the PageSpeed Insights API. Returns scored Performance / SEO / Accessibility / Best Practices and a plain-English summary. Workers-safe (no Node-only APIs).","keywords":["lighthouse","pagespeed","psi","seo","performance","audit","core-web-vitals","cloudflare-workers"],"homepage":"https://designedbyanthony.com/lighthouse","repository":{"type":"git","url":"git+https://github.com/Designed-By-Anthony/lighthouse-scanner.git"},"license":"MIT","author":{"name":"Anthony Jones","email":"anthony@designedbyanthony.com","url":"https://designedbyanthony.com"},"type":"module","main":"./dist/src/index.js","types":"./dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"}},"bin":{"lighthouse-scanner":"dist/bin/lighthouse-scanner.js"},"scripts":{"typecheck":"tsc --noEmit","build":"tsc && chmod +x dist/bin/lighthouse-scanner.js","prepublishOnly":"rm -rf dist && tsc && chmod +x dist/bin/lighthouse-scanner.js"},"devDependencies":{"@types/node":"^20.0.0","typescript":"^5.6.0"},"publishConfig":{"access":"public"},"gitHead":"877a73ca2893431dbf3374ca1f1a135b30ef14d0","_id":"@antjones315/lighthouse-scanner@0.1.0","bugs":{"url":"https://github.com/Designed-By-Anthony/lighthouse-scanner/issues"},"_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-XANsPc+R2bO/vVXkBxLSP5x9fNe4oi64woKdPUfVWlVyLpTbRu3sw8u31ArWDMix5Iicf0SLyRp0lNtpbdxOOA==","shasum":"3e9b779c15027f9864623332adc639200a8886ed","tarball":"https://registry.npmjs.org/@antjones315/lighthouse-scanner/-/lighthouse-scanner-0.1.0.tgz","fileCount":23,"unpackedSize":33507,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIE/NL0Jsr1Zho2YRw+HRTuxNhk7GokV4zvXnmyIcJNedAiEA0sJwsK8mMQlrDWCMqIq+KEjuIFUI7Sm0kDoHGVQ4ND8="}]},"_npmUser":{"name":"antjones315","email":"anthony@designedbyanthony.com"},"directories":{},"maintainers":[{"name":"antjones315","email":"anthony@designedbyanthony.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/lighthouse-scanner_0.1.0_1779987993581_0.09862921128914248"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-28T17:06:33.300Z","0.1.0":"2026-05-28T17:06:33.714Z","modified":"2026-05-28T17:06:33.981Z"},"maintainers":[{"name":"antjones315","email":"anthony@designedbyanthony.com"}],"description":"Run a Google Lighthouse audit on any URL via the PageSpeed Insights API. Returns scored Performance / SEO / Accessibility / Best Practices and a plain-English summary. Workers-safe (no Node-only APIs).","homepage":"https://designedbyanthony.com/lighthouse","keywords":["lighthouse","pagespeed","psi","seo","performance","audit","core-web-vitals","cloudflare-workers"],"repository":{"type":"git","url":"git+https://github.com/Designed-By-Anthony/lighthouse-scanner.git"},"author":{"name":"Anthony Jones","email":"anthony@designedbyanthony.com","url":"https://designedbyanthony.com"},"bugs":{"url":"https://github.com/Designed-By-Anthony/lighthouse-scanner/issues"},"license":"MIT","readme":"<!--\nThis lib is intentionally workspace-orphaned — published to npm separately\nas @antjones315/lighthouse-scanner. Do not delete.\n-->\n\n# lighthouse-scanner\n\nRun a Google Lighthouse audit on any URL via the PageSpeed Insights API. Returns scored Performance / SEO / Accessibility / Best Practices.\n\nWorkers-safe (no Node-only APIs). Runs in Cloudflare Workers, Deno, Bun, Node 20+, and the browser.\n\nBuilt by [ANTHONY studios](https://designedbyanthony.com). Hosted version with AI summary + PDF export at **[designedbyanthony.com/lighthouse](https://designedbyanthony.com/lighthouse)** — always free, no credit card.\n\n## Why this exists\n\nThe Google PageSpeed Insights API is free and excellent, but the raw JSON it returns is a ~2 MB blob full of nested categories, audit IDs, and display strings. This package extracts what you actually want — four scores 0–100 and the diagnostic audits underneath — with sensible failure modes (rate limit, quota, timeout) and SSRF protection on outbound requests.\n\nWe use it internally to power the free audit at [designedbyanthony.com/lighthouse](https://designedbyanthony.com/lighthouse). Open-sourcing the core scanner because it's useful on its own.\n\n## Install\n\n```bash\nnpm install @antjones315/lighthouse-scanner\n# or\npnpm add @antjones315/lighthouse-scanner\n# or\nyarn add @antjones315/lighthouse-scanner\n```\n\n## Library usage\n\n```ts\nimport { runLighthouse } from '@antjones315/lighthouse-scanner';\n\nconst result = await runLighthouse('https://example.com', {\n  // Optional but recommended for production — free key from\n  // https://developers.google.com/speed/docs/insights/v5/get-started\n  apiKey: process.env.PSI_API_KEY,\n});\n\nif (!result.ok) {\n  console.error(result.status, result.error);\n  process.exit(1);\n}\n\nconsole.log(result.outcome.scores);\n// { performance: 87, accessibility: 100, bestPractices: 100, seo: 100 }\n\nconsole.log(result.outcome.degradedReason);\n// null  (or a string if PSI partial-failed and we returned empty scores)\n```\n\n## CLI usage\n\n```bash\n# One-off\nnpx @antjones315/lighthouse-scanner https://example.com\n\n# With a PSI key (avoids strict per-IP rate limits)\nPSI_API_KEY=AIza... npx @antjones315/lighthouse-scanner https://example.com\n```\n\nOutput:\n```\nURL:           https://example.com\nPerformance:   87\nAccessibility: 100\nBest Practices: 100\nSEO:           100\n```\n\n## What it does NOT do\n\n- **No AI summary.** The hosted version at designedbyanthony.com/lighthouse runs Anthropic Claude over the raw audits to produce a plain-English \"here's what to fix first\" — that's the commercial product, not this package.\n- **No PDF generation.** Same — that's the hosted product.\n- **No headless-browser-driven audit.** This uses Google's hosted PSI service, not a local Chrome instance. If you need a local-Chrome audit (with custom flags, throttling, etc.), use [`lighthouse`](https://www.npmjs.com/package/lighthouse) directly.\n\n## Failure modes (all return without throwing)\n\n| Scenario | Behavior |\n|---|---|\n| Network timeout | `ok: true` with `degradedReason` set, scores all `null` |\n| PSI 403 (key invalid / quota disabled) | `ok: true` with `degradedReason`, scores `null` |\n| PSI 429 (rate limited) | `ok: true` with `degradedReason`, scores `null` |\n| PSI 500/503 | One automatic retry, then `ok: false` with status `502` |\n| PSI quota exceeded | `ok: false` with status `503` + `retryAfter: '120'` |\n| Private IP target (SSRF block) | Throws `Error: Blocked private outbound target: …` synchronously |\n\nYou can decide whether to surface `degradedReason` to your users or retry yourself.\n\n## License\n\nMIT — Anthony Jones / Designed by Anthony.\n\nIf you ship this in a commercial product, no attribution required, but a link back to [designedbyanthony.com](https://designedbyanthony.com) would be appreciated.\n","readmeFilename":"README.md","_rev":"1-8eab2f7b5461cc70bcb85c62b5c902b8"}