Merge two sitemap together
npm install sitemap-mergerbash
$ npx sitemap-merger sitemap.xml subdir/other-sitemap.xml build/sitemap.xml --format
`
(With the CLI, argument 1 is the base sitemap, argument 2 is the secondary sitemap, and argument 3 is the destination for the output.)
$3
`js
const sitemapMerger = require("sitemap-merger");
console.log(
sitemapMerger.merge(
"base-xml-sitemap-as-string",
"secondary-xml-sitemap-as-string",
{ prettyPrint: true }
)
);
``