htmx-contract
v0.1.0
Published
Checks the seam between the HTML a route returns and the DOM that receives it. Zero dependencies, built on Bun's HTMLRewriter.
Maintainers
Readme
htmx-contract
Checks the seam between the HTML a route returns and the DOM that receives it.
Zero dependencies. Built on Bun's HTMLRewriter. Knows nothing about your
application.
bun add -d htmx-contractimport { checkDocument, checkResponse, swapAndCheck } from "htmx-contract";
const onPage = await checkDocument(html);
const onResponse = await checkResponse({
page,
response: await res.text(),
headers: res.headers,
status: res.status,
target: "#row-1",
swap: "outerHTML",
});Bun only, for now.
Full documentation: etorhub.github.io/pleyn/htmx-contract/install/ (rules, API, swap model, non-goals).
Licence
MIT.
