Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sitemap2

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sitemap2

Sitemap-generating framework

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
39
increased by8.33%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status Coverage Status npm version

sitemap2

sitemap2 is a high-level sitemap-generating framework that makes creating sitemap XML files easy.

Installation

$ npm install sitemap2 --save

Usage

It will produce 3 files: sitemap.xml (index xml file), sitemap-0.xml(movies links) sitemap-1.xml(books links)

var fs = require('fs');
var Sitemap = require('sitemap2');

var host = 'http://vk.com';

var sm = new Sitemap({hostName: host});

var movies = new Sitemap({hostName: host});
movies.addUrl('http://vk.com/movies/video-1');
movies.addUrl('http://vk.com/movies/video-n');

var books = new Sitemap({hostName: host});
books.addUrl('http://vk.com/books/book-1');
books.addUrl('http://vk.com/books/book-n');

sm.addSitemap(movies);
sm.addSitemap(books);

var files = sm.toXML();

files.forEach(function saveFileToDisk(file) {
    fs.writeFileSync(file.fileName, file.xml);
});

License

MIT

Keywords

FAQs

Package last updated on 19 May 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc