sitemap-xml

0.1.0 • Public • Published

sitemap.xml

Stream URLs to the sitemap.

Build Status

Usage

var sitemap = require('sitemap-xml');
 
// Raw node
var http = require('http');
http.createServer(function (request, response) {
    res.writeHead(200, {'Content-Type': 'application/xml'});
    var stream = sitemap();
    stream.pipe(response);
    stream.write({ loc: 'http://example.com/', lastmod: '2013-04-21' });
    stream.write({ loc: 'http://example.com/page-1', priority: '0.9' });
    stream.end();
})
 
// Express
app.get('/sitemap.xml', function(request, response, next) {
    var stream = sitemap();
    stream.pipe(response);
    stream.write({ loc: 'http://example.com/', lastmod: '2013-04-21' });
    stream.write({ loc: 'http://example.com/page-1', priority: '0.9' });
    stream.end();
});

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i sitemap-xml

    Weekly Downloads

    20

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • bryanburgers