Socket
Socket
Sign inDemoInstall

sitemap-tree

Package Overview
Dependencies
5
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sitemap-tree

sitemap xml file generator


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Install size
1.03 MB
Created
Weekly downloads
 

Readme

Source

Sitemap Tree

Sitemap Tree is a node module for building sitemap and associated index files.

Installation

Installation via npm:

npm install --save sitemap-tree

Require in script

var Sitemap = require('sitemap-tree');

Usage

Example with a single sitemap:

Sitemap.create({destinationPath: "tmp"}).build({
    "type": "sitemap",
    "name": "sitemap1",
    "path": "sitemap1.xml",
    "loc":  "http://website.com/sitemap/sitemap1.xml",
    "lastmod": "2015-08-31T11:00:23-04:00",
    "urls": [{
        "loc":  "http://website.com/url1",
        "lastmod": "2015-08-31T11:00:23-04:00",
        "changefreq": "daily",
        "priority": 0.8
    }]
}, function(error) {
    // ./tmp/sitemap1.xml created, http://www.sitemaps.org/protocol.html#xmlTagDefinitions
});

Example with an index:

Sitemap.create({destinationPath: "tmp"}).build({
    "type": "index",
    "name": "index",
    "path": "index.xml",
    "sitemaps": [
        {
            "type": "sitemap",
            "name": "sitemap2",
            "path": "sitemap2.xml",
            "loc":  "http://website.com/sitemap/sitemap2.xml",
            "lastmod": "2015-08-31T11:00:23-04:00",
            "urls": [{
                "loc":  "http://website.com/url2",
                "lastmod": "2015-08-31T11:00:23-04:00",
                "changefreq": "daily",
                "priority": 0.8
            }]
        }
    ]
}, function(error) {
    // ./tmp/index.xml created, http://www.sitemaps.org/protocol.html#sitemapIndexTagDefinitions
    // ./tmp/sitemap2.xml created, http://www.sitemaps.org/protocol.html#xmlTagDefinitions
});

Keywords

FAQs

Last updated on 15 Feb 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc