Sitemapper is a Node.js module that makes it easy to parse XML sitemaps. It supports single sitemaps, sitemap indexes with multiple sitemaps, and various sitemap formats including image and video sitemaps.
š Installation
# Using npm
npm install sitemapper --save
# Using yarn
yarn add sitemapper
# Using pnpm
pnpm add sitemapper
Sitemapper can be customized with the following options:
Option
Type
Default
Description
url
String
undefined
The URL of the sitemap to parse
timeout
Number
15000
Maximum timeout in milliseconds for each request
concurrency
Number
10
Maximum number of concurrent requests when crawling multiple sitemaps
retries
Number
0
Number of retry attempts for failed requests
debug
Boolean
false
Enable debug logging
rejectUnauthorized
Boolean
true
Reject invalid SSL certificates (like self-signed or expired)
requestHeaders
Object
{}
Additional HTTP headers to include with requests
lastmod
Number
undefined
Only return URLs with lastmod timestamp newer than this value
proxyAgent
HttpProxyAgent | HttpsProxyAgent
undefined
Instance of hpagent for proxy support
exclusions
Array<RegExp>
[]
Array of regex patterns to exclude URLs from results
fields
Object
undefined
Specify which fields to include in the results (see below)
Available Fields
Important: When using the fields option, the return format changes from an array of URL strings to an array of objects containing your selected fields.
For the fields option, specify which fields to include by setting them to true:
Field
Description
loc
URL location of the page
sitemap
URL of the sitemap containing this URL (useful for sitemap indexes)
lastmod
Date of last modification
changefreq
How frequently the page is likely to change
priority
Priority of this URL relative to other URLs
image:loc
URL location of the image (for image sitemaps)
image:title
Title of the image (for image sitemaps)
image:caption
Caption of the image (for image sitemaps)
video:title
Title of the video (for video sitemaps)
video:description
Description of the video (for video sitemaps)
video:thumbnail_loc
Thumbnail URL of the video (for video sitemaps)
Example Default Output (without fields)
// Returns an array of URL strings
[
'https://wp.seantburke.com/?p=234',
'https://wp.seantburke.com/?p=231',
'https://wp.seantburke.com/?p=185',
];
Note: The CLI implementation is basic and does not yet support all options available in the JavaScript API. More advanced features like fields filtering, concurrency control, and different output formats require using the JavaScript API directly.
š¤ Contributing
Contributions from experienced engineers are highly valued. When contributing, please consider:
Guidelines
Maintain backward compatibility where possible
Consider performance implications, particularly for large sitemaps
Add TypeScript types
Add tests for your change
Update documentation and examples
Check for typos
Code should pass ESLint, Prettier, Spell Check and TypeScript checks
Try not to bloat the main dependencies with new packages, dev dependencies are fine
If adding packages, make sure to run npm install with the latest NPM version to update package-lock.json
Pull Request Process
PRs should be focused on a single concern/feature
Include sufficient context in the PR description
Reference any relevant issues
Run npm test locally to verify your changes pass the test
Sometimes the tests will fail since they reference real world sitemaps. Try running it again.
PRs will not run github actions by default, they need to be run manually by @seantomburke
For substantial changes, consider opening an issue for discussion before implementation.
Note: The CI pipeline enforces TypeScript type checking, linting rules, formatting standards, and test coverage thresholds.
š License
This project is licensed under the MIT License - see the LICENSE file for details.
Parser for XML Sitemaps to be used with Robots.txt and web crawlers
The npm package sitemapper receives a total of 41,362 weekly downloads. As such, sitemapper popularity was classified as popular.
We found that sitemapper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 1 open source maintainer collaborating on the project.
Package last updated on 16 Apr 2026
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.
The remediated findings include organization permission bugs, stale project access after transfers, OIDC replay edge cases, audit logging gaps, and an IDOR in API token deletion.