unstale

npm / sitemap

sitemap

What changed in sitemap 5 to 10, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

55 breaking11 security3 deprecations26 new APIs and options8 behavior and defaults11 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

sitemap 1043 changes

Breaking changes 18

  • validateURL now throws InvalidURLError, a subclass of InvalidHostnameError, with a URL-specific message.

    10.0.0release notes

  • The validator accepts only whole yes, Yes, YES, no, No or NO values.

    10.0.0release notes

  • Parser character data longer than 64 KiB for one element is dropped with a warning.

    10.0.0release notes

  • The required Node.js version is now >=22.22.1, previously >=20.19.5.

    10.0.0release notes

  • Truncated XML now rejects, and source-stream failures reject instead of leaving the promise unsettled.

    10.0.0release notes

  • NaN is now reported as PriorityInvalidError, throwing at ErrorLevel.THROW and warning at WARN.

    10.0.0release notes

  • The default limit drops from 50,000 to 45,000 URLs per sitemap; pass limit: 50000 to keep the old output.

    10.0.0release notes

  • The package is ESM-only; the CommonJS build and require export condition are removed. Migrate to import syntax.

    10.0.0release notes

  • Gzipped sitemap files are now named sitemap-N.xml.gz, and the index lists that URL.

    10.0.0release notes

  • The limit accepts only decimal digits; forms such as 1e3, 0x10 and whitespace-padded values are rejected with a consistent error message.

    10.0.0release notes

  • Custom namespace validation now happens in the constructor, so invalid values throw from new SitemapStream().

    10.0.0release notes

  • Item failures now emit a stream error and destroy the stream instead of throwing from write(); callers should listen for error or use pipeline().

    10.0.0release notes

  • The unused UndefinedTargetFolder error class is removed.

    10.0.0release notes

  • Non-numeric or non-finite video duration, rating and view_count values are now invalid.

    10.0.0release notes

  • The bundled schema is found relative to the installed module rather than the working directory, and a missing schema rejects the promise instead of throwing.

    10.0.0release notes

  • error is now a read-only getter for the first error; assigning to it throws a TypeError in strict mode.

    10.0.0release notes

  • The parser now validates <loc> values with validateURL and drops malformed URLs with a warning, or throws under ErrorLevel.THROW.

    10.0.0release notes

  • CDATA sections are treated as ordinary character data in every tag.

    10.0.0release notes

Deprecations 3

  • MAX_URL_ENTRIES is deprecated and unused; parsers cap entries at MAX_SITEMAP_ITEM_LIMIT instead.

    10.0.0release notes

  • The property is renamed from xmlNS to xmlns; xmlNS remains a deprecated alias.

    10.0.0release notes

  • urlCount remains available as a deprecated alias for entryCount.

    10.0.0release notes

New APIs and options 8

  • LIMITS now exports priority and video validation bounds and the priority string regular expression.

    10.0.0release notes

  • Sitemap streams and helpers accept the shared logger option; validation warnings use it, and false silences them.

    10.0.0release notes

  • The Logger type is now exported.

    10.0.0release notes

  • The shared base options type for the XML parser streams is now exported.

    10.0.0release notes

  • The parser enforces the 50,000-entry limit, supports a maxEntries option, and emits maxEntriesExceeded when the cap is crossed.

    10.0.0release notes

  • The index parser gains a capped errors array and errorCount, where it previously kept only the first error.

    10.0.0release notes

  • The item parser gains maxEntries, entryCount and the maxEntriesExceeded event, and stops reading after the cap is crossed.

    10.0.0release notes

  • The item parser caps entries by default and supports maxEntries to set the cap; overflow is reported once.

    10.0.0release notes

Behavior and default changes 5

  • A new error reports alternate links without lang or hreflang; such links are dropped at WARN and SILENT.

    10.0.0release notes

  • validateSMIOptions now reports invalid yes/no video fields with the new InvalidVideoYesNo error.

    10.0.0release notes

  • All entries from the prepended sitemap are written before new URLs; files with over 50,000 URLs fail with exit code 1.

    10.0.0release notes

  • Validation exits with code 1 for invalid sitemaps and code 2 when validation cannot run.

    10.0.0release notes

  • The stream serializes each item itself and outputs one chunk per item; the XML is unchanged.

    10.0.0release notes

Fixes and other changes 9

  • Invalid news and video attribute values now go through errorHandler, including under ErrorLevel.THROW with a custom handler.

    10.0.0release notes

  • Its message now says the limit must be an integer between 1 and 50000.

    10.0.0release notes

  • An index over the entry limit is rejected and reading stops once the limit is crossed; maxEntries above 50,000 no longer raises the wrapper limit.

    10.0.0release notes

  • Stream errors are printed and the command exits with code 1 instead of crashing with an unhandled error event.

    10.0.0release notes

  • Parse, prepend and default modes print stream errors and exit with code 1 instead of crashing; early stdout closure is not treated as an error in those modes.

    10.0.0release notes

  • On sitemap-stream errors or invalid getSitemapStream results, it now destroys itself and emits the error once.

    10.0.0release notes

  • priority now accepts number or string; plain decimal strings are converted to numbers, while other invalid values follow error-level handling.

    10.0.0release notes

  • Ending the stream without items now produces a well-formed empty <urlset> instead of failing with EmptySitemap.

    10.0.0release notes

  • Changing the public level field after construction now takes effect when the stream warns.

    10.0.0release notes

sitemap 926 changes

Breaking changes 6

  • Rejects absolute paths to prevent arbitrary file writes.

    7.1.3, 8.0.3, 9.0.1release notesrelease notesrelease notes

  • Enforces a 50,000 URL hard limit in the parser.

    9.0.1release notes

  • Parser and stream inputs now receive security validation and resource limits; invalid data may be rejected, including disallowed URL protocols, overlong strings, and excessive sitemap resources.

    9.0.0release notes

  • Direct imports of library files from ESM contexts require .js extensions; TypeScript adds these automatically.

    9.0.0release notes

  • Node.js >=20.19.5 is now required; Node.js 14, 16, and 18 are no longer supported.

    9.0.0release notes

  • npm >=10.8.2 is now required.

    9.0.0release notes

Security 4

  • Caps the parser error array at 100 entries to prevent memory DoS.

    8.0.3, 9.0.1release notesrelease notes

  • Escapes xslUrl in the stylesheet processing instruction to prevent XML injection.

    7.1.3, 8.0.3, 9.0.1release notesrelease notesrelease notes

  • A public security limits object is available, covering maximum URL length and sitemap, video, news, and image constraints.

    9.0.0release notes

  • XML generation adds safe attribute and element generation and protection against XML injection attacks.

    9.0.0release notes

New APIs and options 13

  • A public constant provides the default items per sitemap file: 45,000.

    9.0.0release notes

  • An allow/deny type guard is now part of the public API.

    9.0.0release notes

  • A price type guard is now part of the public API.

    9.0.0release notes

  • A resolution type guard is now part of the public API.

    9.0.0release notes

  • A change frequency type guard is now part of the public API.

    9.0.0release notes

  • A yes/no type guard is now part of the public API.

    9.0.0release notes

  • The SimpleSitemapAndIndexOptions interface is now exported.

    9.0.0release notes

  • A limit validation function is now part of the public API.

    9.0.0release notes

  • A path validation function is now part of the public API.

    9.0.0release notes

  • A public base path validation function is now part of the public API.

    9.0.0release notes

  • A URL validation function is now part of the public API.

    9.0.0release notes

  • An XSL URL validation function is now part of the public API.

    9.0.0release notes

  • An object containing regex validators for all sitemap fields is now part of the public API.

    9.0.0release notes

Behavior and default changes 2

  • Destroys source and parser streams immediately when the maxEntries limit is exceeded.

    8.0.3, 9.0.1release notesrelease notes

  • The package now declares module type, with dual ESM/CJS output and conditional exports; both ESM and CommonJS imports continue to work.

    9.0.0release notes

Fixes and other changes 1

sitemap 811 changes

Breaking changes 3

  • The parser now stops emitting items and emits an error when the 50,000 URL hard limit is exceeded, rather than merely logging a warning.

    8.0.3release notes

  • Node.js 12 support was dropped.

    8.0.0release notes

  • Errors are now propagated in SitemapAndIndexStream.

    8.0.0release notes

Security 7

Fixes and other changes 1

  • Custom namespace validation now accepts namespace-qualified attributes such as xsi:schemaLocation, in addition to xmlns:prefix="uri".

    8.0.2release notes

sitemap 76 changes

Breaking changes 4

  • Stops emitting items when the 50,000 URL hard limit is reached, rather than only logging a warning.

    7.1.3release notes

  • Removed the deprecated API; use SitemapAndIndexStream or simpleSitemapAndIndex instead.

    7.0.0release notes

  • Dropped support for Node 10 and added support for Node 16.

    7.0.0release notes

  • Dropped the deprecated getSitemapStream option because it does not return a write stream.

    7.0.0release notes

New APIs and options 2

  • Accepts a maxEntries limit, defaulting to 50,000, and destroys source and parser streams immediately when the limit is breached.

    7.1.3release notes

  • Added an option to simplesitemap that lets users set the location of sitemap files hosted on the site.

    7.0.0release notes

sitemap 614 changes

Breaking changes 12

  • buildSitemapIndex was replaced by SitemapIndexStream.

    6.0.0release notes

  • The CLI no longer accepts multiple file arguments or a mixture of file and streams, except as part of a parameter such as prepend.

    6.0.0release notes

  • The TypeScript type for price:resolution is now more restrictive.

    6.0.0release notes

  • The TypeScript type for price:type is now more restrictive.

    6.0.0release notes

  • The parser now returns a sitemapItem array rather than a config object usable with the removed Sitemap class.

    6.0.0release notes

  • Values supplied to sitemap receive stronger validity checking.

    6.0.0release notes

  • The deprecated Sitemap class was removed.

    6.0.0release notes

  • The deprecated SitemapIndex class was removed.

    6.0.0release notes

  • SitemapIndexStream replaces buildSitemapIndex.

    6.0.0release notes

  • The TypeScript type for view_count is now exclusively a number.

    6.0.0release notes

  • The type was renamed to XMLToSitemapOptions.

    6.0.0release notes

  • This type replaces XMLToISitemapOptions.

    6.0.0release notes

New APIs and options 2

  • The library can accept a stream and automatically write both the index and the sitemaps.

    6.0.0release notes

  • You can turn off XML namespaces or add custom ones.

    6.0.0release notes

sitemap 514 changes

Breaking changes 12

  • The API now returns a promise instead of using a callback.

    5.0.0release notes

  • The cacheTime option is removed because it did not actually cache as written.

    5.0.0release notes

  • Gzip is now enabled by default; pass gzip: false to disable it.

    5.0.0release notes

  • Renames createSitemapsIndex; it returns a promise that resolves to true or throws with an error.

    5.0.0release notes

  • Support for mobile sitemaps has been dropped because the missing Google DTD breaks validation.

    5.0.0release notes

  • Node 8 is no longer supported.

    5.0.0release notes

  • Removes the unused second argument; the signature changes from normalizeURL(url, XMLRoot, hostname) to normalizeURL(url, hostname).

    5.0.0release notes

  • Replaces --line-separated; by default, output is immediately compatible with feeding back into sitemap.

    5.0.0release notes

  • The SitemapIndex class has been dropped; its work was completed during construction, so retaining an instance was unnecessary.

    5.0.0release notes

  • The streaming interface does not support removing sitemap items because it does not retain items after converting them to XML.

    5.0.0release notes

  • Core methods now use streams, making the API about 20% faster and using 10% or less of the memory.

    5.0.0release notes

  • xslURL is removed from all APIs because XML styling is out of scope.

    5.0.0release notes

New APIs and options 1

  • Adds the ability to prepend URLs to an existing sitemap.xml file through the CLI.

    5.0.0release notes

Behavior and default changes 1

  • The CLI now infers JSON input, so the --json option is no longer needed.

    5.0.0release notes