sitepreflight
v0.1.0
Published
Pre-launch checklist for websites. Run one command on a URL and see what you forgot: meta tags, social previews, favicon, sitemap, robots.txt, alt text, heading order.
Maintainers
Readme
sitepreflight
The check you do by hand before every launch, in one command.
Point it at a URL and it tells you what's missing: meta tags, social previews, favicon, sitemap, robots.txt, alt text, heading order, leftover noindex from staging.
npx sitepreflight example.comhttps://example.com/
Basics
! Page language: The <html> tag has no lang attribute
Add lang to <html>, for example <html lang="en">.
SEO
✕ Indexable: The page says noindex
Staging leftovers: remove the noindex before launch.
Social
✕ Open Graph tags: Missing: og:image
Without these, the link shared on WhatsApp or LinkedIn shows a bare URL.
14 passed 2 to review 2 blocking
Fix the blocking items before launch.No install, no config, no account. Works on any site, not just ones you built.
What it checks
| Group | Checks |
| --- | --- |
| Basics | HTTP status, HTTPS, lang, viewport, charset, favicon, time to first byte |
| SEO | Title length, meta description, canonical URL, leftover noindex |
| Social | Open Graph title, description and image, Twitter card |
| Accessibility | One h1, heading order, images without alt, generic link text |
| Crawling | robots.txt, Disallow: / left from staging, sitemap |
Blocking issues (✕) are the ones that break something real in production: a site that can't be indexed, a shared link with no preview, a page unusable on mobile. Everything else is a warning you can weigh up.
Options
npx sitepreflight <url> [options]
--all Show the checks that passed too
--json Print the report as JSON
--strict Exit with code 1 on warnings as well
--no-color Plain output, for logs and CI
-h, --help Show this help
-v, --version Show the versionExit codes: 0 nothing blocking, 1 blocking issues found (or warnings with --strict), 2 the page could not be checked.
In your pipeline
Because it exits non-zero on blocking issues, it works as a gate before a deploy:
- run: npx sitepreflight https://staging.example.com --no-color --strictAs a library
npm install sitepreflightimport { fetchPage, fetchSiteFiles, runChecks, buildReport } from "sitepreflight";
const page = await fetchPage("https://example.com");
const files = await fetchSiteFiles(page.finalUrl);
const report = buildReport(page.url, page.finalUrl, runChecks(page, files));
console.log(report.counts); // { pass: 14, warn: 2, fail: 2 }runChecks is pure: give it HTML and headers and it gives you results, no network involved. Handy if you already have the page.
What it does not do
It reads the HTML the server returns, so content rendered only in the browser is invisible to it. It doesn't measure Core Web Vitals, crawl the whole site or check links one by one. It's a pre-launch checklist, not Lighthouse.
Development
npm install
npm test
npm run dev -- example.com # run the CLI from source
npm run buildLicense
MIT
