JSPM

@jarronb/site-mapper

1.0.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q39053F
  • License MIT

Site mapper utilizing puppeteer to generate a xml sitemap

Package Exports

  • @jarronb/site-mapper

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jarronb/site-mapper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@jarronb/site-mapper

Site-mapper is a package used to generate a XML sitemap utilizing puppeteer-core

Example Usage

const siteMapper = require("@jarronb/site-mapper");

const config = {
  // debug mode for indexer
  debug: false,
  url: {
    protocol: "http://",
    host: "localhost", // or www.sample.com
    port: "3000", // or can be null or ""
  },
  // launch options for puppeteer
  launchOptions: {
    headless: true,
    args: ["--start-maximized"],
  },
  // puppeteer page load event
  // https://pptr.dev/#?product=Puppeteer&version=v5.2.1&show=api-class-page
  page: {
    waitUnitl: "load",
  },
  siteMap: {
    outpath: "sitemap.xml",
  },
  urlDetails: {
    index: {
      priority: 1.0,
      changefreq: "always",
    },
    "/blog": {
      priority: 0.7,
    },
  },
};

const func = async () => {
  let s = new siteMapper(config);
  const indexed = await s.indexer();
  await s.fileWriter(indexed);
};

func();

Read more here