JSPM

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

A very easy sitemap maker library

Package Exports

  • easy-sitemap

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 (easy-sitemap) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

URL Manager

A very easy to use sitemap generator

Usage

  • Import easy-sitemap
import Sitemap from 'easy-sitemap'
// or
const Sitemap = require('easy-sitemap').default
  • Initialize it
// Create a new instance
const sitemap = new Sitemap('https://www.example.com') // initialize using your website base

// if you want to let the library manage the response object the line is this
const sitemap = new Sitemap('https://www.example.com', {
    response: res
})
  • add you're paths
sitemap.addEntry('/path')

// you can also add optionnal elements
sitemap.addEntry('/path', {
    // each one are optionnal and they don't all need to be added
    changefreq: 'always', // webpage change freq
    lastmod: new Date('2021-01-20'), // webpage lastmod Date
    priority: 1 // crawler priority
})
  • finally build it !
// it will return a string containing the whole sitemap
// if you are letting the library manage the response Object it will return an empty string but the page will render ! 
const result = sitemap.build()