First, make sure you have installed Deno and Puppeteer on your machine.
Create the following typescript file and save it. In my example, I have called it sitemap-generator.ts
. Update the websiteUrl variable (in my case https://dartsscoreboard.com) to the site you want to generate the sitemap for. This value is also included in the sitemap.
import puppeteer from "https://deno.land/x/[email protected]/mod.ts";
async function generateSitemap(url: string): Promise<void> {
const browser = await puppeteer.launch();
const page = await browser.newPage();