Socket
Socket
Sign inDemoInstall

@types/express-sitemap-xml

Package Overview
Dependencies
12
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/express-sitemap-xml

TypeScript definitions for express-sitemap-xml


Version published
Weekly downloads
1.3K
increased by3.3%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Installation

npm install --save @types/express-sitemap-xml

Summary

This package contains type definitions for express-sitemap-xml (https://github.com/feross/express-sitemap-xml).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-sitemap-xml.

index.d.ts

import express = require("express");

/**
 * Create a sitemap.xml middleware.
 * @param getUrls Is called at most once per 24 hours. The resulting sitemap(s)
 *   are cached to make repeated HTTP requests faster.
 * @param base Specifies the base URL to be used in case any URLs are specified
 *   as relative URLs. The argument is also used if a sitemap index needs to be
 *   generated and sitemap locations need to be specified, e.g.
 *   `${base}/sitemap-0.xml` becomes `https://bitmidi.com/sitemap-0.xml`.
 */
declare function expressSitemapXml(
    getUrls: () => expressSitemapXml.SitemapLeaf[] | Promise<expressSitemapXml.SitemapLeaf[]>,
    base: string,
): express.RequestHandler;

declare namespace expressSitemapXml {
    interface LeafObject {
        changeFreq?: string | undefined;
        /** specify `true` for today's date */
        lastMod?: string | Date | true | undefined;
        url: string;
    }

    type SitemapLeaf = string | LeafObject;

    interface Sitemap {
        [leaf: string]: string;
    }

    /**
     * @async
     * Create an object where the keys are sitemap URLs to be served by the
     * server and the values are strings of sitemap XML content
     */
    function buildSitemaps(urls: SitemapLeaf[], base: string): Promise<Sitemap>;
}

export = expressSitemapXml;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: @types/express

Credits

These definitions were written by Florian Imdahl, and Piotr Błażejewicz.

FAQs

Last updated on 07 Nov 2023

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