sitemap

  • Version 7.0.0
  • Published
  • 157 kB
  • 4 dependencies
  • MIT license

Install

npm i sitemap
yarn add sitemap
pnpm add sitemap

Overview

Sitemap-generating lib/cli

Index

Variables

Functions

Classes

Interfaces

Enums

Type Aliases

Variables

variable CHANGEFREQ

const CHANGEFREQ: EnumChangefreq[];

    variable validators

    const validators: { [index: string]: RegExp };

      Functions

      function isAllowDeny

      isAllowDeny: (ad: string) => ad is EnumAllowDeny;

        function isPriceType

        isPriceType: (pt: string | PriceType) => pt is PriceType;

          function isResolution

          isResolution: (res: string) => res is Resolution;

            function isValidChangeFreq

            isValidChangeFreq: (freq: string) => freq is EnumChangefreq;

              function isValidYesNo

              isValidYesNo: (yn: string) => yn is EnumYesNo;

                function lineSeparatedURLsToSitemapOptions

                lineSeparatedURLsToSitemapOptions: (
                stream: any,
                { isJSON }?: { isJSON?: boolean }
                ) => any;
                • Takes a stream likely from fs.createReadStream('./path') and returns a stream of sitemap items

                  Parameter stream

                  a stream of line separated urls.

                  Parameter

                  opts.isJSON is the stream line separated JSON. leave undefined to guess

                function mergeStreams

                mergeStreams: (streams: Readable[]) => any;
                • Combines multiple streams into one

                  Parameter streams

                  the streams to combine

                function normalizeURL

                normalizeURL: (
                elem: string | SitemapItemLoose,
                hostname?: string,
                lastmodDateOnly?: boolean
                ) => SitemapItem;
                • Converts the passed in sitemap entry into one capable of being consumed by SitemapItem

                  Parameter elem

                  the string or object to be converted

                  Parameter hostname

                  Returns

                  SitemapItemOptions a strict sitemap item option

                function parseSitemap

                parseSitemap: (xml: any) => Promise<SitemapItem[]>;
                • Read xml and resolve with the configuration that would produce it or reject with an error ``` const { createReadStream } = require('fs') const { parseSitemap, createSitemap } = require('sitemap') parseSitemap(createReadStream('./example.xml')).then( // produces the same xml // you can, of course, more practically modify it or store it (xmlConfig) => console.log(createSitemap(xmlConfig).toString()), (err) => console.log(err) ) ```

                  Parameter xml

                  what to parse {Promise<SitemapItem[]>} resolves with list of sitemap items that can be fed into a SitemapStream. Rejects with an Error object.

                function simpleSitemapAndIndex

                simpleSitemapAndIndex: ({
                hostname,
                sitemapHostname,
                sourceData,
                destinationDir,
                limit,
                gzip,
                publicBasePath,
                }: {
                hostname: string;
                sitemapHostname?: string | undefined;
                sourceData: SitemapItemLoose[] | string | Readable | string[];
                destinationDir: string;
                publicBasePath?: string | undefined;
                limit?: number | undefined;
                gzip?: boolean | undefined;
                }) => Promise<void>;
                • Parameter options

                  Parameter

                  {string} options.hostname - The hostname for all URLs

                  Parameter

                  {string} [options.sitemapHostname] - The hostname for the sitemaps if different than hostname

                  Parameter

                  {SitemapItemLoose[] | string | Readable | string[]} options.sourceData - The urls you want to make a sitemap out of.

                  Parameter

                  {string} options.destinationDir - where to write the sitemaps and index

                  Parameter

                  {string} [options.publicBasePath] - where the sitemaps are relative to the hostname. Defaults to root.

                  Parameter

                  {number} [options.limit] - how many URLs to write before switching to a new file. Defaults to 50k

                  Parameter

                  {boolean} [options.gzip] - whether to compress the written files. Defaults to true

                  Returns

                  {Promise} an empty promise that resolves when everything is done

                function streamToPromise

                streamToPromise: (stream: any) => Promise<Buffer>;
                • Takes a stream returns a promise that resolves when stream emits finish

                  Parameter stream

                  what you want wrapped in a promise

                function validateSMIOptions

                validateSMIOptions: (
                conf: SitemapItem,
                level?: ErrorLevel,
                errorHandler?: ErrorHandler
                ) => SitemapItem;
                • Verifies all data passed in will comply with sitemap spec.

                  Parameter conf

                  Options to validate

                  Parameter level

                  logging level

                  Parameter errorHandler

                  error handling func

                function xmlLint

                xmlLint: (xml: string | Readable) => Promise<void>;
                • Verify the passed in xml is valid. Requires xmllib be installed

                  Parameter xml

                  what you want validated {Promise} resolves on valid rejects [error stderr]

                Classes

                class ChangeFreqInvalidError

                class ChangeFreqInvalidError extends Error {}
                • changefreq property in sitemap is invalid

                constructor

                constructor(url: string, changefreq: any);

                  class EmptySitemap

                  class EmptySitemap extends Error {}

                    constructor

                    constructor();

                      class EmptyStream

                      class EmptyStream extends Error {}

                        constructor

                        constructor();

                          class InvalidAttr

                          class InvalidAttr extends Error {}

                            constructor

                            constructor(key: string);

                              class InvalidAttrValue

                              class InvalidAttrValue extends Error {}

                                constructor

                                constructor(key: string, val: any, validator: RegExp);

                                  class InvalidNewsAccessValue

                                  class InvalidNewsAccessValue extends Error {}

                                    constructor

                                    constructor(url: string, access: any);

                                      class InvalidNewsFormat

                                      class InvalidNewsFormat extends Error {}

                                        constructor

                                        constructor(url: string);

                                          class InvalidVideoCategory

                                          class InvalidVideoCategory extends Error {}

                                            constructor

                                            constructor(url: string, count: number);

                                              class InvalidVideoDescription

                                              class InvalidVideoDescription extends Error {}

                                                constructor

                                                constructor(url: string, length: number);

                                                  class InvalidVideoDuration

                                                  class InvalidVideoDuration extends Error {}

                                                    constructor

                                                    constructor(url: string, duration: any);

                                                      class InvalidVideoFamilyFriendly

                                                      class InvalidVideoFamilyFriendly extends Error {}

                                                        constructor

                                                        constructor(url: string, fam: string);

                                                          class InvalidVideoFormat

                                                          class InvalidVideoFormat extends Error {}

                                                            constructor

                                                            constructor(url: string);

                                                              class InvalidVideoPriceCurrency

                                                              class InvalidVideoPriceCurrency extends Error {}

                                                                constructor

                                                                constructor(url: string, currency: string);

                                                                  class InvalidVideoPriceType

                                                                  class InvalidVideoPriceType extends Error {}

                                                                    constructor

                                                                    constructor(url: string, priceType?: string, price?: string);

                                                                      class InvalidVideoRating

                                                                      class InvalidVideoRating extends Error {}

                                                                        constructor

                                                                        constructor(url: string, title: any, rating: any);

                                                                          class InvalidVideoResolution

                                                                          class InvalidVideoResolution extends Error {}

                                                                            constructor

                                                                            constructor(url: string, resolution: string);

                                                                              class InvalidVideoRestriction

                                                                              class InvalidVideoRestriction extends Error {}

                                                                                constructor

                                                                                constructor(url: string, code: string);

                                                                                  class InvalidVideoRestrictionRelationship

                                                                                  class InvalidVideoRestrictionRelationship extends Error {}

                                                                                    constructor

                                                                                    constructor(url: string, val?: string);

                                                                                      class InvalidVideoTagCount

                                                                                      class InvalidVideoTagCount extends Error {}

                                                                                        constructor

                                                                                        constructor(url: string, count: number);

                                                                                          class InvalidVideoTitle

                                                                                          class InvalidVideoTitle extends Error {}

                                                                                            constructor

                                                                                            constructor(url: string, length: number);

                                                                                              class InvalidVideoViewCount

                                                                                              class InvalidVideoViewCount extends Error {}

                                                                                                constructor

                                                                                                constructor(url: string, count: number);

                                                                                                  class NoConfigError

                                                                                                  class NoConfigError extends Error {}
                                                                                                  • Config was not passed to SitemapItem constructor

                                                                                                  constructor

                                                                                                  constructor(message?: string);

                                                                                                    class NoURLError

                                                                                                    class NoURLError extends Error {}
                                                                                                    • URL in SitemapItem does not exist

                                                                                                    constructor

                                                                                                    constructor(message?: string);

                                                                                                      class ObjectStreamToJSON

                                                                                                      class ObjectStreamToJSON extends Transform {}
                                                                                                      • A Transform that converts a stream of objects into a JSON Array or a line separated stringified JSON

                                                                                                        Parameter lineSeparated

                                                                                                        whether to separate entries by a new line or comma

                                                                                                      constructor

                                                                                                      constructor(opts?: ObjectStreamToJSONOptions);

                                                                                                        property firstWritten

                                                                                                        firstWritten: boolean;

                                                                                                          property lineSeparated

                                                                                                          lineSeparated: boolean;

                                                                                                            class PriorityInvalidError

                                                                                                            class PriorityInvalidError extends Error {}
                                                                                                            • priority property in sitemap is invalid

                                                                                                            constructor

                                                                                                            constructor(url: string, priority: any);

                                                                                                              class ReadlineStream

                                                                                                              class ReadlineStream extends Readable {}
                                                                                                              • Wraps node's ReadLine in a stream

                                                                                                              constructor

                                                                                                              constructor(options: ReadlineStreamOptions);

                                                                                                                class SitemapAndIndexStream

                                                                                                                class SitemapAndIndexStream extends SitemapIndexStream {}

                                                                                                                  constructor

                                                                                                                  constructor(opts: SitemapAndIndexStreamOptions);

                                                                                                                    class SitemapIndexStream

                                                                                                                    class SitemapIndexStream extends Transform {}

                                                                                                                      constructor

                                                                                                                      constructor(opts?: SitemapIndexStreamOptions);

                                                                                                                        property level

                                                                                                                        level: ErrorLevel;

                                                                                                                          property xslUrl

                                                                                                                          xslUrl?: string;

                                                                                                                            class SitemapItemStream

                                                                                                                            class SitemapItemStream extends Transform {}
                                                                                                                            • Takes a stream of SitemapItemOptions and spits out xml for each

                                                                                                                              Parameter level

                                                                                                                              Error level

                                                                                                                              Example 1

                                                                                                                              // writes https://example.comhttps://example.com/2 const smis = new SitemapItemStream({level: 'warn'}) smis.pipe(writestream) smis.write({url: 'https://example.com', img: [], video: [], links: []}) smis.write({url: 'https://example.com/2', img: [], video: [], links: []}) smis.end()

                                                                                                                            constructor

                                                                                                                            constructor(opts?: SitemapItemStreamOptions);

                                                                                                                              property level

                                                                                                                              level: ErrorLevel;

                                                                                                                                class SitemapStream

                                                                                                                                class SitemapStream extends Transform {}
                                                                                                                                • A [Transform](https://nodejs.org/api/stream.html#stream_implementing_a_transform_stream) for turning a [Readable stream](https://nodejs.org/api/stream.html#stream_readable_streams) of either [SitemapItemOptions](#sitemap-item-options) or url strings into a Sitemap. The readable stream it transforms **must** be in object mode.

                                                                                                                                constructor

                                                                                                                                constructor(opts?: SitemapStreamOptions);

                                                                                                                                  property errorHandler

                                                                                                                                  errorHandler?: ErrorHandler;

                                                                                                                                    property hasHeadOutput

                                                                                                                                    hasHeadOutput: boolean;

                                                                                                                                      property hostname

                                                                                                                                      hostname?: string;

                                                                                                                                        property lastmodDateOnly

                                                                                                                                        lastmodDateOnly: boolean;

                                                                                                                                          property level

                                                                                                                                          level: ErrorLevel;

                                                                                                                                            property xmlNS

                                                                                                                                            xmlNS: NSArgs;

                                                                                                                                              property xslUrl

                                                                                                                                              xslUrl?: string;

                                                                                                                                                class UndefinedTargetFolder

                                                                                                                                                class UndefinedTargetFolder extends Error {}
                                                                                                                                                • SitemapIndex target Folder does not exists

                                                                                                                                                constructor

                                                                                                                                                constructor(message?: string);

                                                                                                                                                  class XMLLintUnavailable

                                                                                                                                                  class XMLLintUnavailable extends Error {}

                                                                                                                                                    constructor

                                                                                                                                                    constructor(message?: string);

                                                                                                                                                      class XMLToSitemapItemStream

                                                                                                                                                      class XMLToSitemapItemStream extends Transform {}
                                                                                                                                                      • Takes a stream of xml and transforms it into a stream of SitemapItems Use this to parse existing sitemaps into config options compatible with this library

                                                                                                                                                      constructor

                                                                                                                                                      constructor(opts?: XMLToSitemapItemStreamOptions);

                                                                                                                                                        property level

                                                                                                                                                        level: ErrorLevel;

                                                                                                                                                          property logger

                                                                                                                                                          logger: Logger;

                                                                                                                                                            property saxStream

                                                                                                                                                            saxStream: any;

                                                                                                                                                              Interfaces

                                                                                                                                                              interface Img

                                                                                                                                                              interface Img {}
                                                                                                                                                              • Sitemap Image https://support.google.com/webmasters/answer/178636?hl=en&ref_topic=4581190

                                                                                                                                                              property caption

                                                                                                                                                              caption?: string;
                                                                                                                                                              • The caption of the image

                                                                                                                                                                Example 1

                                                                                                                                                                'Thanksgiving dinner'

                                                                                                                                                              property geoLocation

                                                                                                                                                              geoLocation?: string;
                                                                                                                                                              • The geographic location of the image.

                                                                                                                                                                Example 1

                                                                                                                                                                'Limerick, Ireland'

                                                                                                                                                              property license

                                                                                                                                                              license?: string;
                                                                                                                                                              • A URL to the license of the image.

                                                                                                                                                                Example 1

                                                                                                                                                                'https://example.com/license.txt'

                                                                                                                                                              property title

                                                                                                                                                              title?: string;
                                                                                                                                                              • The title of the image

                                                                                                                                                                Example 1

                                                                                                                                                                'Star Wars EP IV'

                                                                                                                                                              property url

                                                                                                                                                              url: string;
                                                                                                                                                              • The URL of the image

                                                                                                                                                                Example 1

                                                                                                                                                                'https://example.com/image.jpg'

                                                                                                                                                              interface IndexItem

                                                                                                                                                              interface IndexItem {}

                                                                                                                                                                property lastmod

                                                                                                                                                                lastmod?: string;

                                                                                                                                                                  property url

                                                                                                                                                                  url: string;

                                                                                                                                                                    interface LinkItem

                                                                                                                                                                    interface LinkItem {}
                                                                                                                                                                    • https://support.google.com/webmasters/answer/189077

                                                                                                                                                                    property hreflang

                                                                                                                                                                    hreflang?: string;
                                                                                                                                                                    • Example 1

                                                                                                                                                                      'en-us'

                                                                                                                                                                    property lang

                                                                                                                                                                    lang: string;
                                                                                                                                                                    • Example 1

                                                                                                                                                                      'en'

                                                                                                                                                                    property url

                                                                                                                                                                    url: string;

                                                                                                                                                                      interface NewsItem

                                                                                                                                                                      interface NewsItem {}
                                                                                                                                                                      • https://support.google.com/webmasters/answer/74288?hl=en&ref_topic=4581190

                                                                                                                                                                      property access

                                                                                                                                                                      access?: 'Registration' | 'Subscription';

                                                                                                                                                                        property genres

                                                                                                                                                                        genres?: string;
                                                                                                                                                                        • Example 1

                                                                                                                                                                          'PressRelease, Blog'

                                                                                                                                                                        property keywords

                                                                                                                                                                        keywords?: string;
                                                                                                                                                                        • Example 1

                                                                                                                                                                          'business, merger, acquisition'

                                                                                                                                                                        property publication

                                                                                                                                                                        publication: {
                                                                                                                                                                        name: string;
                                                                                                                                                                        /**
                                                                                                                                                                        * The `<language>` is the language of your publication. Use an ISO 639
                                                                                                                                                                        * language code (2 or 3 letters).
                                                                                                                                                                        */
                                                                                                                                                                        language: string;
                                                                                                                                                                        };

                                                                                                                                                                          property publication_date

                                                                                                                                                                          publication_date: string;
                                                                                                                                                                          • Article publication date in W3C format, using either the "complete date" (YYYY-MM-DD) format or the "complete date plus hours, minutes, and seconds"

                                                                                                                                                                          property stock_tickers

                                                                                                                                                                          stock_tickers?: string;
                                                                                                                                                                          • Example 1

                                                                                                                                                                            'NASDAQ:A, NASDAQ:B'

                                                                                                                                                                          property title

                                                                                                                                                                          title: string;
                                                                                                                                                                          • The title of the news article

                                                                                                                                                                            Example 1

                                                                                                                                                                            'Companies A, B in Merger Talks'

                                                                                                                                                                          interface ObjectStreamToJSONOptions

                                                                                                                                                                          interface ObjectStreamToJSONOptions extends TransformOptions {}

                                                                                                                                                                            property lineSeparated

                                                                                                                                                                            lineSeparated: boolean;

                                                                                                                                                                              interface ReadlineStreamOptions

                                                                                                                                                                              interface ReadlineStreamOptions extends ReadableOptions {}

                                                                                                                                                                                property input

                                                                                                                                                                                input: Readable;

                                                                                                                                                                                  interface SitemapAndIndexStreamOptions

                                                                                                                                                                                  interface SitemapAndIndexStreamOptions extends SitemapIndexStreamOptions {}

                                                                                                                                                                                    property getSitemapStream

                                                                                                                                                                                    getSitemapStream: getSitemapStream;

                                                                                                                                                                                      property level

                                                                                                                                                                                      level?: ErrorLevel;

                                                                                                                                                                                        property limit

                                                                                                                                                                                        limit?: number;

                                                                                                                                                                                          interface SitemapIndexStreamOptions

                                                                                                                                                                                          interface SitemapIndexStreamOptions extends TransformOptions {}

                                                                                                                                                                                            property level

                                                                                                                                                                                            level?: ErrorLevel;

                                                                                                                                                                                              property xslUrl

                                                                                                                                                                                              xslUrl?: string;

                                                                                                                                                                                                interface SitemapItem

                                                                                                                                                                                                interface SitemapItem extends SitemapItemBase {}
                                                                                                                                                                                                • Strict options for individual sitemap entries

                                                                                                                                                                                                property img

                                                                                                                                                                                                img: Img[];
                                                                                                                                                                                                  links: LinkItem[];

                                                                                                                                                                                                    property video

                                                                                                                                                                                                    video: VideoItem[];

                                                                                                                                                                                                      interface SitemapItemLoose

                                                                                                                                                                                                      interface SitemapItemLoose extends SitemapItemBase {}
                                                                                                                                                                                                      • Options for individual sitemap entries prior to normalization

                                                                                                                                                                                                      property img

                                                                                                                                                                                                      img?: string | Img | (string | Img)[];

                                                                                                                                                                                                        property lastmodfile

                                                                                                                                                                                                        lastmodfile?: string | Buffer | URL;

                                                                                                                                                                                                          property lastmodISO

                                                                                                                                                                                                          lastmodISO?: string;

                                                                                                                                                                                                            property lastmodrealtime

                                                                                                                                                                                                            lastmodrealtime?: boolean;
                                                                                                                                                                                                              links?: LinkItem[];

                                                                                                                                                                                                                property video

                                                                                                                                                                                                                video?: VideoItemLoose | VideoItemLoose[];

                                                                                                                                                                                                                  interface SitemapItemStreamOptions

                                                                                                                                                                                                                  interface SitemapItemStreamOptions extends TransformOptions {}

                                                                                                                                                                                                                    property level

                                                                                                                                                                                                                    level?: ErrorLevel;

                                                                                                                                                                                                                      interface SitemapStreamOptions

                                                                                                                                                                                                                      interface SitemapStreamOptions extends TransformOptions {}

                                                                                                                                                                                                                        property errorHandler

                                                                                                                                                                                                                        errorHandler?: ErrorHandler;

                                                                                                                                                                                                                          property hostname

                                                                                                                                                                                                                          hostname?: string;

                                                                                                                                                                                                                            property lastmodDateOnly

                                                                                                                                                                                                                            lastmodDateOnly?: boolean;

                                                                                                                                                                                                                              property level

                                                                                                                                                                                                                              level?: ErrorLevel;

                                                                                                                                                                                                                                property xmlns

                                                                                                                                                                                                                                xmlns?: NSArgs;

                                                                                                                                                                                                                                  property xslUrl

                                                                                                                                                                                                                                  xslUrl?: string;

                                                                                                                                                                                                                                    interface VideoItem

                                                                                                                                                                                                                                    interface VideoItem extends VideoItemBase {}
                                                                                                                                                                                                                                    • Sitemap video. <https://support.google.com/webmasters/answer/80471?hl=en&ref_topic=4581190>

                                                                                                                                                                                                                                    property family_friendly

                                                                                                                                                                                                                                    family_friendly?: EnumYesNo;

                                                                                                                                                                                                                                      property live

                                                                                                                                                                                                                                      live?: EnumYesNo;
                                                                                                                                                                                                                                      • Indicates whether the video is a live stream. Supported values are yes or no.

                                                                                                                                                                                                                                      property rating

                                                                                                                                                                                                                                      rating?: number;
                                                                                                                                                                                                                                      • The rating of the video. Supported values are float numbers.

                                                                                                                                                                                                                                        Example 1

                                                                                                                                                                                                                                        2.5

                                                                                                                                                                                                                                      property requires_subscription

                                                                                                                                                                                                                                      requires_subscription?: EnumYesNo;
                                                                                                                                                                                                                                      • Indicates whether a subscription (either paid or free) is required to view the video. Allowed values are yes or no.

                                                                                                                                                                                                                                      property tag

                                                                                                                                                                                                                                      tag: string[];
                                                                                                                                                                                                                                      • An arbitrary string tag describing the video. Tags are generally very short descriptions of key concepts associated with a video or piece of content.

                                                                                                                                                                                                                                        Example 1

                                                                                                                                                                                                                                        ['Baking']

                                                                                                                                                                                                                                      interface VideoItemLoose

                                                                                                                                                                                                                                      interface VideoItemLoose extends VideoItemBase {}
                                                                                                                                                                                                                                      • Sitemap video. <https://support.google.com/webmasters/answer/80471?hl=en&ref_topic=4581190>

                                                                                                                                                                                                                                      property family_friendly

                                                                                                                                                                                                                                      family_friendly?: EnumYesNo | boolean;

                                                                                                                                                                                                                                        property live

                                                                                                                                                                                                                                        live?: EnumYesNo | boolean;
                                                                                                                                                                                                                                        • Indicates whether the video is a live stream. Supported values are yes or no.

                                                                                                                                                                                                                                        property rating

                                                                                                                                                                                                                                        rating?: string | number;
                                                                                                                                                                                                                                        • The rating of the video. Supported values are float numbers.

                                                                                                                                                                                                                                          Example 1

                                                                                                                                                                                                                                          2.5

                                                                                                                                                                                                                                        property requires_subscription

                                                                                                                                                                                                                                        requires_subscription?: EnumYesNo | boolean;

                                                                                                                                                                                                                                          property tag

                                                                                                                                                                                                                                          tag?: string | string[];
                                                                                                                                                                                                                                          • An arbitrary string tag describing the video. Tags are generally very short descriptions of key concepts associated with a video or piece of content.

                                                                                                                                                                                                                                            Example 1

                                                                                                                                                                                                                                            ['Baking']

                                                                                                                                                                                                                                          interface XMLToSitemapItemStreamOptions

                                                                                                                                                                                                                                          interface XMLToSitemapItemStreamOptions extends TransformOptions {}

                                                                                                                                                                                                                                            property level

                                                                                                                                                                                                                                            level?: ErrorLevel;

                                                                                                                                                                                                                                              property logger

                                                                                                                                                                                                                                              logger?: Logger | false;

                                                                                                                                                                                                                                                Enums

                                                                                                                                                                                                                                                enum EnumAllowDeny

                                                                                                                                                                                                                                                enum EnumAllowDeny {
                                                                                                                                                                                                                                                ALLOW = 'allow',
                                                                                                                                                                                                                                                DENY = 'deny',
                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                  member ALLOW

                                                                                                                                                                                                                                                  ALLOW = 'allow'

                                                                                                                                                                                                                                                    member DENY

                                                                                                                                                                                                                                                    DENY = 'deny'

                                                                                                                                                                                                                                                      enum EnumChangefreq

                                                                                                                                                                                                                                                      enum EnumChangefreq {
                                                                                                                                                                                                                                                      DAILY = 'daily',
                                                                                                                                                                                                                                                      MONTHLY = 'monthly',
                                                                                                                                                                                                                                                      ALWAYS = 'always',
                                                                                                                                                                                                                                                      HOURLY = 'hourly',
                                                                                                                                                                                                                                                      WEEKLY = 'weekly',
                                                                                                                                                                                                                                                      YEARLY = 'yearly',
                                                                                                                                                                                                                                                      NEVER = 'never',
                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                      • How frequently the page is likely to change. This value provides general information to search engines and may not correlate exactly to how often they crawl the page. Please note that the value of this tag is considered a hint and not a command. See <https://www.sitemaps.org/protocol.html#xmlTagDefinitions> for the acceptable values

                                                                                                                                                                                                                                                      member ALWAYS

                                                                                                                                                                                                                                                      ALWAYS = 'always'

                                                                                                                                                                                                                                                        member DAILY

                                                                                                                                                                                                                                                        DAILY = 'daily'

                                                                                                                                                                                                                                                          member HOURLY

                                                                                                                                                                                                                                                          HOURLY = 'hourly'

                                                                                                                                                                                                                                                            member MONTHLY

                                                                                                                                                                                                                                                            MONTHLY = 'monthly'

                                                                                                                                                                                                                                                              member NEVER

                                                                                                                                                                                                                                                              NEVER = 'never'

                                                                                                                                                                                                                                                                member WEEKLY

                                                                                                                                                                                                                                                                WEEKLY = 'weekly'

                                                                                                                                                                                                                                                                  member YEARLY

                                                                                                                                                                                                                                                                  YEARLY = 'yearly'

                                                                                                                                                                                                                                                                    enum EnumYesNo

                                                                                                                                                                                                                                                                    enum EnumYesNo {
                                                                                                                                                                                                                                                                    YES = 'YES',
                                                                                                                                                                                                                                                                    NO = 'NO',
                                                                                                                                                                                                                                                                    Yes = 'Yes',
                                                                                                                                                                                                                                                                    No = 'No',
                                                                                                                                                                                                                                                                    yes = 'yes',
                                                                                                                                                                                                                                                                    no = 'no',
                                                                                                                                                                                                                                                                    }

                                                                                                                                                                                                                                                                      member no

                                                                                                                                                                                                                                                                      no = 'no'

                                                                                                                                                                                                                                                                        member No

                                                                                                                                                                                                                                                                        No = 'No'

                                                                                                                                                                                                                                                                          member NO

                                                                                                                                                                                                                                                                          NO = 'NO'

                                                                                                                                                                                                                                                                            member yes

                                                                                                                                                                                                                                                                            yes = 'yes'

                                                                                                                                                                                                                                                                              member Yes

                                                                                                                                                                                                                                                                              Yes = 'Yes'

                                                                                                                                                                                                                                                                                member YES

                                                                                                                                                                                                                                                                                YES = 'YES'

                                                                                                                                                                                                                                                                                  enum ErrorLevel

                                                                                                                                                                                                                                                                                  enum ErrorLevel {
                                                                                                                                                                                                                                                                                  SILENT = 'silent',
                                                                                                                                                                                                                                                                                  WARN = 'warn',
                                                                                                                                                                                                                                                                                  THROW = 'throw',
                                                                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                                                                  • How to handle errors in passed in urls

                                                                                                                                                                                                                                                                                  member SILENT

                                                                                                                                                                                                                                                                                  SILENT = 'silent'
                                                                                                                                                                                                                                                                                  • Validation will be skipped and nothing logged or thrown.

                                                                                                                                                                                                                                                                                  member THROW

                                                                                                                                                                                                                                                                                  THROW = 'throw'
                                                                                                                                                                                                                                                                                  • An Error will be thrown on encountering invalid data.

                                                                                                                                                                                                                                                                                  member WARN

                                                                                                                                                                                                                                                                                  WARN = 'warn'
                                                                                                                                                                                                                                                                                  • If an invalid value is encountered, a console.warn will be called with details

                                                                                                                                                                                                                                                                                  enum IndexTagNames

                                                                                                                                                                                                                                                                                  enum IndexTagNames {
                                                                                                                                                                                                                                                                                  sitemap = 'sitemap',
                                                                                                                                                                                                                                                                                  loc = 'loc',
                                                                                                                                                                                                                                                                                  lastmod = 'lastmod',
                                                                                                                                                                                                                                                                                  }

                                                                                                                                                                                                                                                                                    member lastmod

                                                                                                                                                                                                                                                                                    lastmod = 'lastmod'

                                                                                                                                                                                                                                                                                      member loc

                                                                                                                                                                                                                                                                                      loc = 'loc'

                                                                                                                                                                                                                                                                                        member sitemap

                                                                                                                                                                                                                                                                                        sitemap = 'sitemap'

                                                                                                                                                                                                                                                                                          enum TagNames

                                                                                                                                                                                                                                                                                          enum TagNames {
                                                                                                                                                                                                                                                                                          url = 'url',
                                                                                                                                                                                                                                                                                          loc = 'loc',
                                                                                                                                                                                                                                                                                          urlset = 'urlset',
                                                                                                                                                                                                                                                                                          lastmod = 'lastmod',
                                                                                                                                                                                                                                                                                          changefreq = 'changefreq',
                                                                                                                                                                                                                                                                                          priority = 'priority',
                                                                                                                                                                                                                                                                                          'video:thumbnail_loc' = 'video:thumbnail_loc',
                                                                                                                                                                                                                                                                                          'video:video' = 'video:video',
                                                                                                                                                                                                                                                                                          'video:title' = 'video:title',
                                                                                                                                                                                                                                                                                          'video:description' = 'video:description',
                                                                                                                                                                                                                                                                                          'video:tag' = 'video:tag',
                                                                                                                                                                                                                                                                                          'video:duration' = 'video:duration',
                                                                                                                                                                                                                                                                                          'video:player_loc' = 'video:player_loc',
                                                                                                                                                                                                                                                                                          'video:content_loc' = 'video:content_loc',
                                                                                                                                                                                                                                                                                          'image:image' = 'image:image',
                                                                                                                                                                                                                                                                                          'image:loc' = 'image:loc',
                                                                                                                                                                                                                                                                                          'image:geo_location' = 'image:geo_location',
                                                                                                                                                                                                                                                                                          'image:license' = 'image:license',
                                                                                                                                                                                                                                                                                          'image:title' = 'image:title',
                                                                                                                                                                                                                                                                                          'image:caption' = 'image:caption',
                                                                                                                                                                                                                                                                                          'video:requires_subscription' = 'video:requires_subscription',
                                                                                                                                                                                                                                                                                          'video:publication_date' = 'video:publication_date',
                                                                                                                                                                                                                                                                                          'video:id' = 'video:id',
                                                                                                                                                                                                                                                                                          'video:restriction' = 'video:restriction',
                                                                                                                                                                                                                                                                                          'video:family_friendly' = 'video:family_friendly',
                                                                                                                                                                                                                                                                                          'video:view_count' = 'video:view_count',
                                                                                                                                                                                                                                                                                          'video:uploader' = 'video:uploader',
                                                                                                                                                                                                                                                                                          'video:expiration_date' = 'video:expiration_date',
                                                                                                                                                                                                                                                                                          'video:platform' = 'video:platform',
                                                                                                                                                                                                                                                                                          'video:price' = 'video:price',
                                                                                                                                                                                                                                                                                          'video:rating' = 'video:rating',
                                                                                                                                                                                                                                                                                          'video:category' = 'video:category',
                                                                                                                                                                                                                                                                                          'video:live' = 'video:live',
                                                                                                                                                                                                                                                                                          'video:gallery_loc' = 'video:gallery_loc',
                                                                                                                                                                                                                                                                                          'news:news' = 'news:news',
                                                                                                                                                                                                                                                                                          'news:publication' = 'news:publication',
                                                                                                                                                                                                                                                                                          'news:name' = 'news:name',
                                                                                                                                                                                                                                                                                          'news:access' = 'news:access',
                                                                                                                                                                                                                                                                                          'news:genres' = 'news:genres',
                                                                                                                                                                                                                                                                                          'news:publication_date' = 'news:publication_date',
                                                                                                                                                                                                                                                                                          'news:title' = 'news:title',
                                                                                                                                                                                                                                                                                          'news:keywords' = 'news:keywords',
                                                                                                                                                                                                                                                                                          'news:stock_tickers' = 'news:stock_tickers',
                                                                                                                                                                                                                                                                                          'news:language' = 'news:language',
                                                                                                                                                                                                                                                                                          'mobile:mobile' = 'mobile:mobile',
                                                                                                                                                                                                                                                                                          'xhtml:link' = 'xhtml:link',
                                                                                                                                                                                                                                                                                          'expires' = 'expires',
                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                            member 'expires'

                                                                                                                                                                                                                                                                                            'expires' = 'expires'

                                                                                                                                                                                                                                                                                              member 'image:caption'

                                                                                                                                                                                                                                                                                              'image:caption' = 'image:caption'

                                                                                                                                                                                                                                                                                                member 'image:geo_location'

                                                                                                                                                                                                                                                                                                'image:geo_location' = 'image:geo_location'

                                                                                                                                                                                                                                                                                                  member 'image:image'

                                                                                                                                                                                                                                                                                                  'image:image' = 'image:image'

                                                                                                                                                                                                                                                                                                    member 'image:license'

                                                                                                                                                                                                                                                                                                    'image:license' = 'image:license'

                                                                                                                                                                                                                                                                                                      member 'image:loc'

                                                                                                                                                                                                                                                                                                      'image:loc' = 'image:loc'

                                                                                                                                                                                                                                                                                                        member 'image:title'

                                                                                                                                                                                                                                                                                                        'image:title' = 'image:title'

                                                                                                                                                                                                                                                                                                          member 'mobile:mobile'

                                                                                                                                                                                                                                                                                                          'mobile:mobile' = 'mobile:mobile'

                                                                                                                                                                                                                                                                                                            member 'news:access'

                                                                                                                                                                                                                                                                                                            'news:access' = 'news:access'

                                                                                                                                                                                                                                                                                                              member 'news:genres'

                                                                                                                                                                                                                                                                                                              'news:genres' = 'news:genres'

                                                                                                                                                                                                                                                                                                                member 'news:keywords'

                                                                                                                                                                                                                                                                                                                'news:keywords' = 'news:keywords'

                                                                                                                                                                                                                                                                                                                  member 'news:language'

                                                                                                                                                                                                                                                                                                                  'news:language' = 'news:language'

                                                                                                                                                                                                                                                                                                                    member 'news:name'

                                                                                                                                                                                                                                                                                                                    'news:name' = 'news:name'

                                                                                                                                                                                                                                                                                                                      member 'news:news'

                                                                                                                                                                                                                                                                                                                      'news:news' = 'news:news'

                                                                                                                                                                                                                                                                                                                        member 'news:publication_date'

                                                                                                                                                                                                                                                                                                                        'news:publication_date' = 'news:publication_date'

                                                                                                                                                                                                                                                                                                                          member 'news:publication'

                                                                                                                                                                                                                                                                                                                          'news:publication' = 'news:publication'

                                                                                                                                                                                                                                                                                                                            member 'news:stock_tickers'

                                                                                                                                                                                                                                                                                                                            'news:stock_tickers' = 'news:stock_tickers'

                                                                                                                                                                                                                                                                                                                              member 'news:title'

                                                                                                                                                                                                                                                                                                                              'news:title' = 'news:title'

                                                                                                                                                                                                                                                                                                                                member 'video:category'

                                                                                                                                                                                                                                                                                                                                'video:category' = 'video:category'

                                                                                                                                                                                                                                                                                                                                  member 'video:content_loc'

                                                                                                                                                                                                                                                                                                                                  'video:content_loc' = 'video:content_loc'

                                                                                                                                                                                                                                                                                                                                    member 'video:description'

                                                                                                                                                                                                                                                                                                                                    'video:description' = 'video:description'

                                                                                                                                                                                                                                                                                                                                      member 'video:duration'

                                                                                                                                                                                                                                                                                                                                      'video:duration' = 'video:duration'

                                                                                                                                                                                                                                                                                                                                        member 'video:expiration_date'

                                                                                                                                                                                                                                                                                                                                        'video:expiration_date' = 'video:expiration_date'

                                                                                                                                                                                                                                                                                                                                          member 'video:family_friendly'

                                                                                                                                                                                                                                                                                                                                          'video:family_friendly' = 'video:family_friendly'

                                                                                                                                                                                                                                                                                                                                            member 'video:gallery_loc'

                                                                                                                                                                                                                                                                                                                                            'video:gallery_loc' = 'video:gallery_loc'

                                                                                                                                                                                                                                                                                                                                              member 'video:id'

                                                                                                                                                                                                                                                                                                                                              'video:id' = 'video:id'

                                                                                                                                                                                                                                                                                                                                                member 'video:live'

                                                                                                                                                                                                                                                                                                                                                'video:live' = 'video:live'

                                                                                                                                                                                                                                                                                                                                                  member 'video:platform'

                                                                                                                                                                                                                                                                                                                                                  'video:platform' = 'video:platform'

                                                                                                                                                                                                                                                                                                                                                    member 'video:player_loc'

                                                                                                                                                                                                                                                                                                                                                    'video:player_loc' = 'video:player_loc'

                                                                                                                                                                                                                                                                                                                                                      member 'video:price'

                                                                                                                                                                                                                                                                                                                                                      'video:price' = 'video:price'

                                                                                                                                                                                                                                                                                                                                                        member 'video:publication_date'

                                                                                                                                                                                                                                                                                                                                                        'video:publication_date' = 'video:publication_date'

                                                                                                                                                                                                                                                                                                                                                          member 'video:rating'

                                                                                                                                                                                                                                                                                                                                                          'video:rating' = 'video:rating'

                                                                                                                                                                                                                                                                                                                                                            member 'video:requires_subscription'

                                                                                                                                                                                                                                                                                                                                                            'video:requires_subscription' = 'video:requires_subscription'

                                                                                                                                                                                                                                                                                                                                                              member 'video:restriction'

                                                                                                                                                                                                                                                                                                                                                              'video:restriction' = 'video:restriction'

                                                                                                                                                                                                                                                                                                                                                                member 'video:tag'

                                                                                                                                                                                                                                                                                                                                                                'video:tag' = 'video:tag'

                                                                                                                                                                                                                                                                                                                                                                  member 'video:thumbnail_loc'

                                                                                                                                                                                                                                                                                                                                                                  'video:thumbnail_loc' = 'video:thumbnail_loc'

                                                                                                                                                                                                                                                                                                                                                                    member 'video:title'

                                                                                                                                                                                                                                                                                                                                                                    'video:title' = 'video:title'

                                                                                                                                                                                                                                                                                                                                                                      member 'video:uploader'

                                                                                                                                                                                                                                                                                                                                                                      'video:uploader' = 'video:uploader'

                                                                                                                                                                                                                                                                                                                                                                        member 'video:video'

                                                                                                                                                                                                                                                                                                                                                                        'video:video' = 'video:video'

                                                                                                                                                                                                                                                                                                                                                                          member 'video:view_count'

                                                                                                                                                                                                                                                                                                                                                                          'video:view_count' = 'video:view_count'

                                                                                                                                                                                                                                                                                                                                                                            member 'xhtml:link'

                                                                                                                                                                                                                                                                                                                                                                            'xhtml:link' = 'xhtml:link'

                                                                                                                                                                                                                                                                                                                                                                              member changefreq

                                                                                                                                                                                                                                                                                                                                                                              changefreq = 'changefreq'

                                                                                                                                                                                                                                                                                                                                                                                member lastmod

                                                                                                                                                                                                                                                                                                                                                                                lastmod = 'lastmod'

                                                                                                                                                                                                                                                                                                                                                                                  member loc

                                                                                                                                                                                                                                                                                                                                                                                  loc = 'loc'

                                                                                                                                                                                                                                                                                                                                                                                    member priority

                                                                                                                                                                                                                                                                                                                                                                                    priority = 'priority'

                                                                                                                                                                                                                                                                                                                                                                                      member url

                                                                                                                                                                                                                                                                                                                                                                                      url = 'url'

                                                                                                                                                                                                                                                                                                                                                                                        member urlset

                                                                                                                                                                                                                                                                                                                                                                                        urlset = 'urlset'

                                                                                                                                                                                                                                                                                                                                                                                          Type Aliases

                                                                                                                                                                                                                                                                                                                                                                                          type ErrorHandler

                                                                                                                                                                                                                                                                                                                                                                                          type ErrorHandler = (error: Error, level: ErrorLevel) => void;

                                                                                                                                                                                                                                                                                                                                                                                            type PriceType

                                                                                                                                                                                                                                                                                                                                                                                            type PriceType = 'rent' | 'purchase' | 'RENT' | 'PURCHASE';

                                                                                                                                                                                                                                                                                                                                                                                              type Resolution

                                                                                                                                                                                                                                                                                                                                                                                              type Resolution = 'HD' | 'hd' | 'sd' | 'SD';

                                                                                                                                                                                                                                                                                                                                                                                                Package Files (10)

                                                                                                                                                                                                                                                                                                                                                                                                Dependencies (4)

                                                                                                                                                                                                                                                                                                                                                                                                Dev Dependencies (27)

                                                                                                                                                                                                                                                                                                                                                                                                Peer Dependencies (0)

                                                                                                                                                                                                                                                                                                                                                                                                No peer dependencies.

                                                                                                                                                                                                                                                                                                                                                                                                Badge

                                                                                                                                                                                                                                                                                                                                                                                                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                                                                                                                                                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/sitemap.

                                                                                                                                                                                                                                                                                                                                                                                                • Markdown
                                                                                                                                                                                                                                                                                                                                                                                                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/sitemap)
                                                                                                                                                                                                                                                                                                                                                                                                • HTML
                                                                                                                                                                                                                                                                                                                                                                                                  <a href="https://www.jsdocs.io/package/sitemap"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>