Socket
Socket
Sign inDemoInstall

express-simple-sitemap

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    express-simple-sitemap

The simplest way to add a sitemap to an express application


Version published
Weekly downloads
5
decreased by-68.75%
Maintainers
1
Install size
227 kB
Created
Weekly downloads
 

Readme

Source

Build Status Coverage Status

express-simple-sitemap

The simplest way to add a sitemap to an express application.

Installation

$ npm install express-simple-sitemap

or

$ yarn add express-simple-sitemap

Usage

// express setup
const express = require('express');
const app = express();

// import express-simple-sitemap
const sitemap = require('express-simple-sitemap');

// add express-simple-sitemap as middleware
app.use(sitemap({
    sitemapUrl: '/sitemap.xml', // optional, default value is '/sitemap.xml'
    urls: [
        {
            url: 'https://github.com/jenbuzz',
            lastmod: '2018-12-08', // optional
            changefreq: 'daily', // optional
            priority: 1.0, // optional
        },
        {
            url: 'https://github.com/jenbuzz/express-simple-sitemap',
        },
    ]
}));

Output:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <url>
        <loc>https://github.com/jenbuzz</loc>
        <lastmod>2018-12-08</lastmod>
        <changefreq>daily</changefreq>
        <priority>1</priority>
    </url>
    <url>
        <loc>https://github.com/jenbuzz/express-simple-sitemap</loc>
    </url>
</urlset>

License

This package is open-sourced software licensed under the MIT license

Keywords

FAQs

Last updated on 28 Aug 2019

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