Functions
The package is ESM. Everything below is a named export of safi-studio-scanner.
audit
Crawls from startUrl, runs the selected rules against every page, scores the findings, and resolves to the report object. This is the only function that performs a run; everything else either wraps it or formats its output.
Order of work: fetch robots.txt and sitemap.xml, crawl the pages, render them if a browser or a PageSpeed key was supplied, run the rules, aggregate.
Throws if startUrl is not a valid URL. A page that fails to fetch is still reported, carrying its status and error rather than taking the run down.
auditToHtml
Runs an audit and returns the report as one self-contained HTML document: inline styles, no external requests. Write it to a file, serve it, or attach it to an email.
auditToMarkdown
Runs an audit and returns Markdown: a score summary, then per-category headings with a findings table.
auditScore
Runs an audit and returns only the overall score, 0 to 100. The whole audit still runs, so this is a convenience, not a fast path.
render
Formats a report you already have. Synchronous. Audit once, emit every format:
allRules
Every built-in rule, in registration order. 93 of them.
selectRules
Filters a rule array by category. only is applied first, then skip removes from what is left. This is the same function audit() uses internally, exported so you can preview exactly what a set of options will run.
DEFAULTS
The default option object. Read it rather than hard-coding values, so your code follows the package if a default changes.
Types
Every type is exported as well: AuditOptions, AuditReport, PageReport, CategoryScore, Finding, Rule, RuleResult, RuleContext, PageContext, SiteContext, Format, Status, Severity. See types.