Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Save sitemap links from two URLs into separate files.
const getLinks = require('sitemap-links');
fs = require('fs');
(async () => {
const newSitemapLink = '';
const oldSitemapLink = '';
const newLinks = await getLinks(newSitemapLink);
const oldLinks = await getLinks(oldSitemapLink);
newLinks.sort();
oldLinks.sort();
fs.writeFile('new.md', newLinks.join('\n'), function (err) {
console.log('Extract saved successful');
});
fs.writeFile('old.md', oldLinks.join('\n'), function (err) {
console.log('Extract saved successful');
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment