sitemap-manager
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

sitemap-manager

An easy way to create sitemaps!

Features

  • Easy to use 😲
  • Work fast 🚀
  • Xml with xsl. For search engines or for human visions? Don't choose, for both! 🥳
  • Put different pages into different sitemaps. 🧺

Usage

Step 1. Install sitemap-manager.

// For npm users
npm install sitemap-manager --save

// For yarn users
yarn add sitemap-manager

Step2. Import sitemap-manager

const { SitemapManager } = require('sitemap-manager')
// or
import { SitemapManager } from 'sitemap-manager'

Step3. "New" a class

const MySitemap = new SitemapManager({
    /* Options here */
    siteURL: ''/*URL*/,
    pathPrefix: ''/*Site Prefix*/,
    outDir: ''/*Output dir*/,
})

Step4. Add urls

MySitemap.addUrl(/*Category name here*/, [
    { loc: ''/*URL*/, lastmod: ''||new Date()/*Last modification time*/, changefreq: ''||1-7/*Change frequence*/, priority: 0.0-1.0 /*Priority*/ },
    /*You can add more!*/
])

Step5. Finish!

MySitemap.finish().then(()=>{/*sth here*/}).catch((e)=>{/*sth here*/})

Check Wiki for more information.

LICENSE

MIT

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i sitemap-manager

    Weekly Downloads

    8

    Version

    2.2.0

    License

    MIT

    Unpacked Size

    36.9 kB

    Total Files

    21

    Last publish

    Collaborators

    • cbw2007