Effortlessly create compliant XML sitemaps. Our agent crawls your site and generates a perfectly structured `sitemap.xml` file to boost your SEO and ensure search engines discover every page.
import Sitemap from "@do-inc/sitemap.xml";
// Crawl a website and generate its sitemap
const sitemap = await Sitemap.generate({
url: "https://your-website.com",
options: {
// Optionally exclude specific paths or patterns
exclude: ["/admin/*", "/cart", "/private/"]
}
});
// Returns the full sitemap.xml content as a string
console.log(sitemap.content);