1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Import Astral
import { launch } from "jsr:@astral/astral@0.4.3";
import { Command } from "jsr:@cliffy/command@1.0.0-rc.5";
const command = new Command().arguments("<app>").action(async (_, app) => {
// Launch the browser
const browser = await launch();
// Open a new page
const page = await browser.newPage(`https://${app}.localhost`);
// Take a screenshot of the page and save that to disk
const screenshot = await page.screenshot();
Deno.stdout.write(screenshot);
browser.close();
});
await command.parse();
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
July 8, 2024