@camasuvi/readability-lab-cli
v0.1.1
Published
Inspect, compare and verify reading presentation on real pages (rlab CLI + Playwright library).
Readme
@camasuvi/readability-lab-cli
rlab: measure how text reads on a page in a real browser, and gate CI on the result. Part of Readability Lab.
npm install --save-dev @camasuvi/readability-lab-cli
npx playwright install chromium
npx rlab check https://example.com/article --selector article --out reports/articlerlab inspect <url|file>measures the reading region and writesreport.json,report.mdandreport.html.rlab check <url|file>also runs WCAG 1.4.12 text spacing, 1.4.10 reflow at 320 CSS px and a 200% zoom approximation, then applies your policy.rlab compare <before.json> <after.json>says what changed and whether the two runs are comparable.rlab recipe css|tokens|spec|validate <recipe.json>,rlab claims,rlab claim <ID>.
Run rlab --help for every option.
Exit codes: 0 ok · 1 policy failure · 2 usage error · 3 the page could not be inspected as requested (browser, navigation, HTTP error, missing region). Heuristic deviations never fail a build by default; only performed accessibility checks do.
As a library, with Playwright:
import { inspectUrl, inspectPage } from "@camasuvi/readability-lab-cli";
const { report } = await inspectUrl({ target: "http://localhost:3000/docs", selector: "main", scenarios: ["text-spacing", "reflow-320"] });CI setup: docs/ci.md. Automated checks cover only what the report lists as performed; they are not a WCAG certification.
Node 20 or later. Apache-2.0.
