
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@webstandard/sitemap
Advanced tools
Silent, precise, effective. No ghost routes. No false intel. Every URL accounted for.
Canonical URL:
https://alexstevovich.com/a/webstandard-sitemap-nodejs
Software URL:
https://midnightcitylights.com/software/webstandard-sitemap-nodejs
@webstandard/sitemap is a minimal, standards-compliant generator for producing sitemap.xml files in Node.js.
It provides clean classes for defining URLs, modification dates, and sitemap indexes — then outputs canonical XML exactly as search engines expect.
npm install @webstandard/sitemap
import { SitemapXml, SitemapXmlUrl } from '@webstandard/sitemap';
// Create a sitemap instance
const sitemap = new SitemapXml();
// Add URLs
sitemap.addUrl(
new SitemapXmlUrl('/', {
priority: 1.0,
changefreq: 'daily',
lastmod: new Date('2024-02-20'),
}),
);
sitemap.addUrl(
new SitemapXmlUrl('/about', {
priority: 0.8,
changefreq: 'weekly',
lastmod: new Date('2024-02-18'),
}),
);
// Generate XML
const xml = sitemap.output({
domain: 'https://example.com',
dateFormat: 'date-only',
});
console.log(xml);
import { SitemapXmlIndex, SitemapXmlIndexItem } from '@webstandard/sitemap';
const index = new SitemapXmlIndex();
index.addItem(
new SitemapXmlIndexItem('/sitemap1.xml', {
lastmod: new Date('2024-02-20'),
}),
);
index.addItem(
new SitemapXmlIndexItem('/sitemap2.xml', {
lastmod: new Date('2024-02-18'),
}),
);
const xml = index.output({
domain: 'https://example.com',
dateFormat: 'date-only',
});
console.log(xml);
Both SitemapXml and SitemapXmlIndex support full JSON serialization and rebuilding:
const json = sitemap.toJSON();
const restored = SitemapXml.fromJSON(json);
I provide a package for robots.txt as well.
https://alexstevovich.com/a/webstandard-robots-nodejs
This package is also mirrored here: SitemapTeam6
Licensed under the Apache License 2.0.
FAQs
A standards-compliant generator for producing sitemap.xml files
The npm package @webstandard/sitemap receives a total of 2 weekly downloads. As such, @webstandard/sitemap popularity was classified as not popular.
We found that @webstandard/sitemap 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.
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.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.