Generate XML sitemaps for websites, helping search engines discover and index pages efficiently.


You can install seo-sitemap-generator using npm:

npm install seo-sitemap-generator


To use seo-sitemap-generator, follow these steps:

Import the generateSitemap function from the package:

const { generateSitemap } = require("seo-sitemap-generator");

Prepare an array of URLs to include in the sitemap:

const urls = [
  // Add more URLs as needed

Generate the XML sitemap using the generateSitemap function:

const sitemap = generateSitemap(urls);

The sitemap variable will contain the generated XML sitemap as a string.

You can then save the sitemap to a file, send it as a response in an HTTP request, or perform any other necessary operations with it.