Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sitemap-links

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sitemap-links - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

12

index.js

@@ -12,2 +12,3 @@ const fetch = require('node-fetch');

if (urlset)
// Sitemap contains URLs directly, return them
return urlset.url.loc

@@ -17,3 +18,10 @@ ? urlset.url.loc // Only single URL in sitemap

// Sitemap contains URLs to other sitemap(s), download them resursively
if (sitemapindex) {
// Contains only a single sitemap
if (sitemapindex.sitemap.loc)
return Promise.all([
fetch_sitemap(sitemapindex.sitemap.loc),
]);
// Recursively fetch all sitemaps inside current sitemap and fetch links

@@ -31,3 +39,3 @@ // Using Promise.all() for running in parallel

})
.catch(e => console.log(e.message));
.catch(e => console.log(e));

@@ -46,3 +54,3 @@ const get_sitemap_links = async (url, timeout) => {

} catch (e) {
throw new Error('Unable to fetch sitemap.', e.message);
throw new Error('Unable to fetch sitemap.', e);
}

@@ -49,0 +57,0 @@ };

2

package.json
{
"name": "sitemap-links",
"version": "1.0.1",
"version": "1.0.2",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc