Saltar al contingut

Astral

Astral

Terminal window
deno init astral
cd astral
deno add add jsr:@astral/astral
screenshot.ts
// Import Astral
import { launch } from "@astral/astral"
// Launch the browser
await using browser = await launch();
// Open a new page
await using page = await browser.newPage("https://deno.land");
// Take a screenshot of the page and save that to disk
const screenshot = await page.screenshot();
Deno.writeFileSync("screenshot.png", screenshot);
// Clean up is performed automatically
Terminal window
deno run --allow-all .\screenshot.ts

El contingut d'aquest lloc web té llicència CC BY-NC-ND 4.0.

©2022-2025 xtec.dev