Skip to content

Bunwright

TypeScript-first browser automation built on Bun.WebView — a smaller, Bun-native alternative for flows where Playwright would be heavier than necessary.
import { browser } from "bunwright";
const page = await browser.newPage();
await page
.navigate("https://example.com/login")
.type("label:Username", "user@example.com")
.type("label:Password", process.env.APP_PASSWORD!)
.click("role:button[name='Login']")
.waitForURL("**/dashboard")
.screenshot("./dashboard.png");
await browser.close();

Bun-native

Built directly on Bun.WebView — zero runtime dependencies, no browser downloads. Uses the Chrome or WebKit already on the machine.

Playwright-style API

Pages, locators, auto-waiting, semantic selectors. Familiar surface, smaller scope.

Chainable

Actions queue lazily and run on await, with fail-fast semantics and per-step results via .all().

Auto-waiting & retries

Every action waits for visible + enabled, then retries up to 3 times with exponential backoff within retryTimeout.

Semantic selectors

role:, label:, text:,css:, xpath: — prefixed strings that read like intent, not brittle DOM paths.

Scriptable

Write a TypeScript file, run it with bunx bunwright script.ts or plain bun run. .env loading built in.