sitemaps

A simple sitemap.xml generator.

Usage no npm install needed!

<script type="module">
  import sitemaps from 'https://cdn.skypack.dev/sitemaps';
</script>

README

sitemaps

NPM Build Status

A simple sitemap.xml generator.

Install

$ npm i sitemaps --save

Usage

const sitemaps = require('sitemaps');

const filePath = `${__dirname}/sitemap.xml`;

const links = [
    {
        loc: 'https://example.com',
        priority: '1.00',
        changefreq: 'weekly',
    },
    {
        loc: 'https://example.com/about',
        priority: '0.80',
        changefreq: 'monthly',
    },
    {
        loc: 'https://example.com/services',
        priority: '0.80',
        changefreq: 'monthly',
    },
    {
        loc: 'https://example.com/contact',
        priority: '0.60',
        changefreq: 'monthly',
    },
];

sitemaps(filePath, links);

console.log(`Sitemap.xml generated at: ${filePath}`);

License

Open source under the terms of the MIT License.