npm.io
1.0.0 • Published 10 years ago

sitemap-writer

Licence
MIT
Version
1.0.0
Deps
1
Vulns
0
Weekly
0

SitemapWriter for Node.js

Based on XMLWriter (Inist-CNRS/node-xml-writer)

Installation

npm install sitemap-daemon

Example

import {SitemapWriter} from 'sitemap-writer'

var w = new SitemapWriter();
w.startDocument()
w.startURLSet();
w.writeURL({loc: '/'});
w.startURL({loc: '/abc'});
w.writeImage({loc: '/img/1.jpg'});
w.endURL();
w.endURLSet();
w.endDocument();

console.log('sitemap: %s', w.toString());