Socket
Socket
Sign inDemoInstall

sitemapper

Package Overview
Dependencies
Maintainers
0
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sitemapper - npm Package Compare versions

Comparing version 3.2.11 to 3.2.12

2

lib/assets/sitemapper.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xml2js=require("xml2js"),_got=_interopRequireDefault(require("got")),_zlib=_interopRequireDefault(require("zlib")),_pLimit=_interopRequireDefault(require("p-limit")),_isGzip=_interopRequireDefault(require("is-gzip"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}class Sitemapper{constructor(a){var b=a||{requestHeaders:{}};this.url=b.url,this.timeout=b.timeout||15e3,this.timeoutTable={},this.lastmod=b.lastmod||0,this.requestHeaders=b.requestHeaders,this.debug=b.debug,this.concurrency=b.concurrency||10,this.retries=b.retries||0,this.rejectUnauthorized=!1!==b.rejectUnauthorized,this.fields=b.fields||!1}fetch(){var a=arguments,b=this;return _asyncToGenerator(function*(){var c=0<a.length&&a[0]!==void 0?a[0]:b.url,d={url:"",sites:[],errors:[]};b.debug&&b.lastmod&&console.debug("Using minimum lastmod value of ".concat(b.lastmod));try{d=yield b.crawl(c)}catch(a){b.debug&&console.error(a)}return{url:c,sites:d.sites||[],errors:d.errors||[]}})()}static get timeout(){return this.timeout}static set timeout(a){this.timeout=a}static get lastmod(){return this.lastmod}static set lastmod(a){this.lastmod=a}static set url(a){this.url=a}static get url(){return this.url}static set debug(a){this.debug=a}static get debug(){return this.debug}parse(){var a=arguments,b=this;return _asyncToGenerator(function*(){var c=0<a.length&&a[0]!==void 0?a[0]:b.url,d={method:"GET",resolveWithFullResponse:!0,gzip:!0,responseType:"buffer",headers:b.requestHeaders,https:{rejectUnauthorized:b.rejectUnauthorized}};try{var e=_got.default.get(c,d);b.initializeTimeout(c,e);var f=yield e;if(!f||200!==f.statusCode)return clearTimeout(b.timeoutTable[c]),{error:f.error,data:f};var g=(0,_isGzip.default)(f.rawBody)?yield b.decompressResponseBody(f.body):f.body;var h=yield(0,_xml2js.parseStringPromise)(g);return{error:null,data:h}}catch(a){return"CancelError"===a.name?{error:"Request timed out after ".concat(b.timeout," milliseconds for url: '").concat(c,"'"),data:a}:"HTTPError"===a.name?{error:"HTTP Error occurred: ".concat(a.message),data:a}:{error:"Error occurred: ".concat(a.name),data:a}}})()}initializeTimeout(a,b){this.timeoutTable[a]=setTimeout(()=>b.cancel(),this.timeout)}crawl(a){var b=arguments,c=this;return _asyncToGenerator(function*(){var d=1<b.length&&b[1]!==void 0?b[1]:0;try{var{error:e,data:f}=yield c.parse(a);if(clearTimeout(c.timeoutTable[a]),e)return d<c.retries?(c.debug&&console.log("(Retry attempt: ".concat(d+1," / ").concat(c.retries,") ").concat(a," due to ").concat(f.name," on previous request")),c.crawl(a,d+1)):(c.debug&&console.error("Error occurred during \"crawl('".concat(a,"')\":\n\r Error: ").concat(e)),{sites:[],errors:[{type:f.name,message:e,url:a,retries:d}]});if(f&&f.urlset&&f.urlset.url){c.debug&&console.debug("Urlset found during \"crawl('".concat(a,"')\""));var g=f.urlset.url.filter(a=>{if(0===c.lastmod)return!0;if(void 0===a.lastmod)return!1;var b=new Date(a.lastmod[0]).getTime();return b>=c.lastmod}).map(a=>{if(!c.fields)return a.loc&&a.loc[0];var b={};for(var[d,e]of Object.entries(c.fields))e&&(b[d]=a[d][0]);return b});return{sites:g,errors:[]}}if(f&&f.sitemapindex){c.debug&&console.debug("Additional sitemap found during \"crawl('".concat(a,"')\""));var h=f.sitemapindex.sitemap.map(a=>a.loc&&a.loc[0]),i=(0,_pLimit.default)(c.concurrency),j=h.map(a=>i(()=>c.crawl(a))),k=yield Promise.all(j),l=k.filter(a=>0===a.errors.length).reduce((a,b)=>{var{sites:c}=b;return[...a,...c]},[]),m=k.filter(a=>0!==a.errors.length).reduce((a,b)=>{var{errors:c}=b;return[...a,...c]},[]);return{sites:l,errors:m}}return d<c.retries?(c.debug&&console.log("(Retry attempt: ".concat(d+1," / ").concat(c.retries,") ").concat(a," due to ").concat(f.name," on previous request")),c.crawl(a,d+1)):(c.debug&&console.error("Unknown state during \"crawl('".concat(a,")'\":"),e,f),{sites:[],errors:[{url:a,type:f.name||"UnknownStateError",message:"An unknown error occurred.",retries:d}]})}catch(a){c.debug&&c.debug&&console.error(a)}})()}getSites(){var a=arguments,b=this;return _asyncToGenerator(function*(){var c=0<a.length&&a[0]!==void 0?a[0]:b.url,d=1<a.length?a[1]:void 0;console.warn("\r\nWarning:","function .getSites() is deprecated, please use the function .fetch()\r\n");var e={},f=[];try{var g=yield b.fetch(c);f=g.sites}catch(a){e=a}return d(e,f)})()}decompressResponseBody(a){return new Promise((b,c)=>{var d=Buffer.from(a);_zlib.default.gunzip(d,(a,d)=>{a?c(a):b(d)})})}}exports.default=Sitemapper,module.exports=exports.default,module.exports.default=exports.default;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xml2js=require("xml2js"),_got=_interopRequireDefault(require("got")),_zlib=_interopRequireDefault(require("zlib")),_pLimit=_interopRequireDefault(require("p-limit")),_isGzip=_interopRequireDefault(require("is-gzip"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function g(a){asyncGeneratorStep(i,e,f,g,h,"next",a)}function h(a){asyncGeneratorStep(i,e,f,g,h,"throw",a)}var i=b.apply(c,d);g(void 0)})}}class Sitemapper{constructor(a){var b=a||{requestHeaders:{}};this.url=b.url,this.timeout=b.timeout||15e3,this.timeoutTable={},this.lastmod=b.lastmod||0,this.requestHeaders=b.requestHeaders,this.debug=b.debug,this.concurrency=b.concurrency||10,this.retries=b.retries||0,this.rejectUnauthorized=!1!==b.rejectUnauthorized,this.fields=b.fields||!1,this.proxyAgent=b.proxyAgent||{}}fetch(){var a=arguments,b=this;return _asyncToGenerator(function*(){var c=0<a.length&&a[0]!==void 0?a[0]:b.url,d={url:"",sites:[],errors:[]};b.debug&&b.lastmod&&console.debug("Using minimum lastmod value of ".concat(b.lastmod));try{d=yield b.crawl(c)}catch(a){b.debug&&console.error(a)}return{url:c,sites:d.sites||[],errors:d.errors||[]}})()}static get timeout(){return this.timeout}static set timeout(a){this.timeout=a}static get lastmod(){return this.lastmod}static set lastmod(a){this.lastmod=a}static set url(a){this.url=a}static get url(){return this.url}static set debug(a){this.debug=a}static get debug(){return this.debug}parse(){var a=arguments,b=this;return _asyncToGenerator(function*(){var c=0<a.length&&a[0]!==void 0?a[0]:b.url,d={method:"GET",resolveWithFullResponse:!0,gzip:!0,responseType:"buffer",headers:b.requestHeaders,https:{rejectUnauthorized:b.rejectUnauthorized},agent:b.proxyAgent};try{var e=_got.default.get(c,d);b.initializeTimeout(c,e);var f=yield e;if(!f||200!==f.statusCode)return clearTimeout(b.timeoutTable[c]),{error:f.error,data:f};var g=(0,_isGzip.default)(f.rawBody)?yield b.decompressResponseBody(f.body):f.body;var h=yield(0,_xml2js.parseStringPromise)(g);return{error:null,data:h}}catch(a){return"CancelError"===a.name?{error:"Request timed out after ".concat(b.timeout," milliseconds for url: '").concat(c,"'"),data:a}:"HTTPError"===a.name?{error:"HTTP Error occurred: ".concat(a.message),data:a}:{error:"Error occurred: ".concat(a.name),data:a}}})()}initializeTimeout(a,b){this.timeoutTable[a]=setTimeout(()=>b.cancel(),this.timeout)}crawl(a){var b=arguments,c=this;return _asyncToGenerator(function*(){var d=1<b.length&&b[1]!==void 0?b[1]:0;try{var{error:e,data:f}=yield c.parse(a);if(clearTimeout(c.timeoutTable[a]),e)return d<c.retries?(c.debug&&console.log("(Retry attempt: ".concat(d+1," / ").concat(c.retries,") ").concat(a," due to ").concat(f.name," on previous request")),c.crawl(a,d+1)):(c.debug&&console.error("Error occurred during \"crawl('".concat(a,"')\":\n\r Error: ").concat(e)),{sites:[],errors:[{type:f.name,message:e,url:a,retries:d}]});if(f&&f.urlset&&f.urlset.url){c.debug&&console.debug("Urlset found during \"crawl('".concat(a,"')\""));var g=f.urlset.url.filter(a=>{if(0===c.lastmod)return!0;if(void 0===a.lastmod)return!1;var b=new Date(a.lastmod[0]).getTime();return b>=c.lastmod}).map(a=>{if(!c.fields)return a.loc&&a.loc[0];var b={};for(var[d,e]of Object.entries(c.fields))e&&(b[d]=a[d][0]);return b});return{sites:g,errors:[]}}if(f&&f.sitemapindex){c.debug&&console.debug("Additional sitemap found during \"crawl('".concat(a,"')\""));var h=f.sitemapindex.sitemap.map(a=>a.loc&&a.loc[0]),i=(0,_pLimit.default)(c.concurrency),j=h.map(a=>i(()=>c.crawl(a))),k=yield Promise.all(j),l=k.filter(a=>0===a.errors.length).reduce((a,b)=>{var{sites:c}=b;return[...a,...c]},[]),m=k.filter(a=>0!==a.errors.length).reduce((a,b)=>{var{errors:c}=b;return[...a,...c]},[]);return{sites:l,errors:m}}return d<c.retries?(c.debug&&console.log("(Retry attempt: ".concat(d+1," / ").concat(c.retries,") ").concat(a," due to ").concat(f.name," on previous request")),c.crawl(a,d+1)):(c.debug&&console.error("Unknown state during \"crawl('".concat(a,")'\":"),e,f),{sites:[],errors:[{url:a,type:f.name||"UnknownStateError",message:"An unknown error occurred.",retries:d}]})}catch(a){c.debug&&c.debug&&console.error(a)}})()}getSites(){var a=arguments,b=this;return _asyncToGenerator(function*(){var c=0<a.length&&a[0]!==void 0?a[0]:b.url,d=1<a.length?a[1]:void 0;console.warn("\r\nWarning:","function .getSites() is deprecated, please use the function .fetch()\r\n");var e={},f=[];try{var g=yield b.fetch(c);f=g.sites}catch(a){e=a}return d(e,f)})()}decompressResponseBody(a){return new Promise((b,c)=>{var d=Buffer.from(a);_zlib.default.gunzip(d,(a,d)=>{a?c(a):b(d)})})}}exports.default=Sitemapper,module.exports=exports.default,module.exports.default=exports.default;
//# sourceMappingURL=sitemapper.js.map

@@ -1,2 +0,2 @@

"use strict";require("async"),require("assert"),require("should");var _isUrl=_interopRequireDefault(require("is-url")),_sitemapper=_interopRequireDefault(require("../../lib/assets/sitemapper.js"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var sitemapper;describe("Sitemapper",function(){beforeEach(()=>{sitemapper=new _sitemapper.default}),describe("Sitemapper Class",function(){it("should have initializeTimeout method",()=>{sitemapper.initializeTimeout.should.be.Function}),it("should have crawl method",()=>{sitemapper.crawl.should.be.Function}),it("should have parse method",()=>{sitemapper.parse.should.be.Function}),it("should have fetch method",()=>{sitemapper.fetch.should.be.Function}),it("should construct with a url",()=>{sitemapper=new _sitemapper.default({url:"google.com"}),sitemapper.url.should.equal("google.com")}),it("should construct with a timeout",()=>{sitemapper=new _sitemapper.default({timeout:1e3}),sitemapper.timeout.should.equal(1e3)}),it("should set timeout",()=>{sitemapper.timeout=1e3,sitemapper.timeout.should.equal(1e3)}),it("should set url",()=>{sitemapper.url=1e3,sitemapper.url.should.equal(1e3)})}),describe("fetch Method resolves sites to array",function(){it("https://wp.seantburke.com/sitemap.xml sitemaps should be an array",function(a){this.timeout(3e4);sitemapper.fetch("https://wp.seantburke.com/sitemap.xml").then(b=>{b.sites.should.be.Array,b.url.should.equal("https://wp.seantburke.com/sitemap.xml"),b.sites.length.should.be.above(2),(0,_isUrl.default)(b.sites[0]).should.be.true,a()}).catch(b=>{console.error("Test failed"),a(b)})}),it("gibberish.gibberish should fail silently with an empty array",function(a){this.timeout(3e4);sitemapper.debug=!0,sitemapper.fetch("http://gibberish.gibberish").then(b=>{b.sites.should.be.Array,b.errors.should.be.Array,b.errors.length.should.be.greaterThan(0),b.errors.length.should.be.greaterThan(0),console.log(b),a()}).catch(b=>{console.error("Test failed"),a(b)})}),it("https://webflow.com/sitemap.xml sitemaps should be an array",function(a){this.timeout(3e4);sitemapper.fetch("https://webflow.com/sitemap.xml").then(b=>{b.sites.should.be.Array,b.url.should.equal("https://webflow.com/sitemap.xml"),b.sites.length.should.be.above(2),(0,_isUrl.default)(b.sites[0]).should.be.true,a()}).catch(b=>{console.error("Test failed"),a(b)})}),it("https://www.golinks.io/sitemap.xml sitemaps should be an array",function(a){this.timeout(3e4);sitemapper.timeout=5e3,sitemapper.fetch("https://www.golinks.io/sitemap.xml").then(b=>{b.sites.should.be.Array,b.url.should.equal("https://www.golinks.io/sitemap.xml"),b.sites.length.should.be.above(2),(0,_isUrl.default)(b.sites[0]).should.be.true,a()}).catch(b=>{console.error("Test failed"),a(b)})}),it("https://www.golinks.io/sitemap.xml sitemaps should return an empty array when timing out",function(a){this.timeout(3e4);sitemapper.timeout=1,sitemapper.fetch("https://www.golinks.io/sitemap.xml").then(b=>{b.sites.should.be.Array,b.errors.should.be.Array,console.log(b),a()}).catch(b=>{console.error("Test failed"),a(b)})}),it("https://www.golinks.com/blog/sitemap.xml sitemaps should return an empty array when timing out",function(a){this.timeout(3e4);sitemapper.timeout=1e4,sitemapper.fetch("https://www.golinks.com/blog/sitemap.xml").then(b=>{b.sites.should.be.Array,b.errors.should.be.Array,a()}).catch(b=>{console.error("Test failed"),a(b)})}),it("https://www.banggood.com/sitemap/category.xml.gz gzip should be a non-empty array",function(a){this.timeout(3e4);sitemapper.timeout=1e4,sitemapper.fetch("https://www.banggood.com/sitemap/category.xml.gz").then(b=>{b.sites.should.be.Array,b.sites.length.should.be.greaterThan(0),a()}).catch(b=>{console.error("Test failed"),a(b)})})}),describe("gzipped sitemaps",function(){beforeEach(()=>{sitemapper=new _sitemapper.default({requestHeaders:{"Accept-Encoding":"gzip,deflate,sdch"}})}),it("https://www.banggood.com/sitemap/category.xml.gz gzip should be a non-empty array",function(a){this.timeout(3e4);sitemapper.timeout=1e4,sitemapper.fetch("https://www.banggood.com/sitemap/category.xml.gz").then(b=>{b.sites.should.be.Array,b.errors.should.be.Array,b.sites.length.should.be.greaterThan(0),a()}).catch(b=>{console.error("Test failed"),a(b)})}),it.skip("https://foo.com/sitemap.xml should allow insecure request",function(a){this.timeout(3e4);sitemapper.timeout=1e4,sitemapper.rejectUnauthorized=!0,sitemapper.fetch("https://foo.com/sitemap.xml").then(b=>{b.sites.should.be.Array,b.errors.should.be.Array,b.errors.should.containEql({type:"RequestError",message:"Error occurred: RequestError",url:"https://foo.com/sitemap.xml",retries:0}),a()}).catch(b=>{console.error("Test failed"),a(b)})}),it("https://foo.com/sitemap.xml should not allow insecure request",function(a){this.timeout(3e4);sitemapper.timeout=1e4,sitemapper.rejectUnauthorized=!1,sitemapper.fetch("https://foo.com/sitemap.xml").then(b=>{b.sites.should.be.Array,b.errors.should.be.Array,b.errors.should.containEql({type:"HTTPError",message:"HTTP Error occurred: Response code 404 (Not Found)",url:"https://foo.com/sitemap.xml",retries:0}),a()}).catch(b=>{console.error("Test failed"),a(b)})})}),describe("getSites method",function(){it("getSites should be backwards compatible",function(a){this.timeout(3e4);sitemapper.getSites("https://wp.seantburke.com/sitemap.xml",(b,c)=>{c.should.be.Array,(0,_isUrl.default)(c[0]).should.be.true,a()})})})});
"use strict";require("async"),require("assert"),require("should");var _isUrl=_interopRequireDefault(require("is-url")),_sitemapper=_interopRequireDefault(require("../../lib/assets/sitemapper.js"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var sitemapper;describe("Sitemapper",function(){beforeEach(()=>{sitemapper=new _sitemapper.default}),describe("Sitemapper Class",function(){it("should have initializeTimeout method",()=>{sitemapper.initializeTimeout.should.be.Function}),it("should have crawl method",()=>{sitemapper.crawl.should.be.Function}),it("should have parse method",()=>{sitemapper.parse.should.be.Function}),it("should have fetch method",()=>{sitemapper.fetch.should.be.Function}),it("should construct with a url",()=>{sitemapper=new _sitemapper.default({url:"google.com"}),sitemapper.url.should.equal("google.com")}),it("should construct with a timeout",()=>{sitemapper=new _sitemapper.default({timeout:1e3}),sitemapper.timeout.should.equal(1e3)}),it("should set timeout",()=>{sitemapper.timeout=1e3,sitemapper.timeout.should.equal(1e3)}),it("should set url",()=>{sitemapper.url=1e3,sitemapper.url.should.equal(1e3)})}),describe("fetch Method resolves sites to array",function(){it("https://wp.seantburke.com/sitemap.xml sitemaps should be an array",function(a){this.timeout(3e4);sitemapper.fetch("https://wp.seantburke.com/sitemap.xml").then(b=>{b.sites.should.be.Array,b.url.should.equal("https://wp.seantburke.com/sitemap.xml"),b.sites.length.should.be.above(2),(0,_isUrl.default)(b.sites[0]).should.be.true,a()}).catch(b=>{console.error("Test failed"),a(b)})}),it("gibberish.gibberish should fail silently with an empty array",function(a){this.timeout(3e4);sitemapper.debug=!0,sitemapper.fetch("http://gibberish.gibberish").then(b=>{b.sites.should.be.Array,b.errors.should.be.Array,b.errors.length.should.be.greaterThan(0),b.errors.length.should.be.greaterThan(0),console.log(b),a()}).catch(b=>{console.error("Test failed"),a(b)})}),it("https://webflow.com/sitemap.xml sitemaps should be an array",function(a){this.timeout(3e4);sitemapper.fetch("https://webflow.com/sitemap.xml").then(b=>{b.sites.should.be.Array,b.url.should.equal("https://webflow.com/sitemap.xml"),b.sites.length.should.be.above(2),(0,_isUrl.default)(b.sites[0]).should.be.true,a()}).catch(b=>{console.error("Test failed"),a(b)})}),it("https://www.golinks.io/sitemap.xml sitemaps should be an array",function(a){this.timeout(3e4);sitemapper.timeout=5e3,sitemapper.fetch("https://www.golinks.io/sitemap.xml").then(b=>{b.sites.should.be.Array,b.url.should.equal("https://www.golinks.io/sitemap.xml"),b.sites.length.should.be.above(2),(0,_isUrl.default)(b.sites[0]).should.be.true,a()}).catch(b=>{console.error("Test failed"),a(b)})}),it("https://www.golinks.io/sitemap.xml sitemaps should return an empty array when timing out",function(a){this.timeout(3e4);sitemapper.timeout=1,sitemapper.fetch("https://www.golinks.io/sitemap.xml").then(b=>{b.sites.should.be.Array,b.errors.should.be.Array,console.log(b),a()}).catch(b=>{console.error("Test failed"),a(b)})}),it("https://www.golinks.com/blog/sitemap.xml sitemaps should return an empty array when timing out",function(a){this.timeout(3e4);sitemapper.timeout=1e4,sitemapper.fetch("https://www.golinks.com/blog/sitemap.xml").then(b=>{b.sites.should.be.Array,b.errors.should.be.Array,a()}).catch(b=>{console.error("Test failed"),a(b)})}),it("https://www.banggood.com/sitemap/category.xml.gz gzip should be a non-empty array",function(a){this.timeout(3e4);sitemapper.timeout=1e4,sitemapper.fetch("https://www.banggood.com/sitemap/category.xml.gz").then(b=>{b.sites.should.be.Array,b.sites.length.should.be.greaterThan(0),a()}).catch(b=>{console.error("Test failed"),a(b)})})}),describe("gzipped sitemaps",function(){beforeEach(()=>{sitemapper=new _sitemapper.default({requestHeaders:{"Accept-Encoding":"gzip,deflate,sdch"}})}),it("https://www.banggood.com/sitemap/category.xml.gz gzip should be a non-empty array",function(a){this.timeout(3e4);sitemapper.timeout=1e4,sitemapper.fetch("https://www.banggood.com/sitemap/category.xml.gz").then(b=>{b.sites.should.be.Array,b.errors.should.be.Array,b.sites.length.should.be.greaterThan(0),a()}).catch(b=>{console.error("Test failed"),status,a(b)})}),it.skip("https://foo.com/sitemap.xml should allow insecure request",function(a){this.timeout(3e4);sitemapper.timeout=1e4,sitemapper.rejectUnauthorized=!0,sitemapper.fetch("https://foo.com/sitemap.xml").then(b=>{b.sites.should.be.Array,b.errors.should.be.Array,b.errors.should.containEql({type:"RequestError",message:"Error occurred: RequestError",url:"https://foo.com/sitemap.xml",retries:0}),a()}).catch(b=>{console.error("Test failed"),a(b)})}),it("https://foo.com/sitemap.xml should not allow insecure request",function(a){this.timeout(3e4);sitemapper.timeout=1e4,sitemapper.rejectUnauthorized=!1,sitemapper.fetch("https://foo.com/sitemap.xml").then(b=>{b.sites.should.be.Array,b.errors.should.be.Array,b.errors.should.containEql({type:"HTTPError",message:"HTTP Error occurred: Response code 404 (Not Found)",url:"https://foo.com/sitemap.xml",retries:0}),a()}).catch(b=>{console.error("Test failed"),a(b)})})}),describe("getSites method",function(){it("getSites should be backwards compatible",function(a){this.timeout(3e4);sitemapper.getSites("https://wp.seantburke.com/sitemap.xml",(b,c)=>{c.should.be.Array,(0,_isUrl.default)(c[0]).should.be.true,a()})})})});
//# sourceMappingURL=test.js.map
{
"name": "sitemapper",
"version": "3.2.11",
"version": "3.2.12",
"description": "Parser for XML Sitemaps to be used with Robots.txt and web crawlers",

@@ -5,0 +5,0 @@ "keywords": [

@@ -81,2 +81,3 @@ ## Sitemap-parser

+ `field` : (Object) - An object of fields to be returned from the sitemap. For Example: `{ loc: true, lastmod: true, changefreq: true, priority: true }`. Leaving a field out has the same effect as `field: false`. If not specified sitemapper defaults to returning the 'classic' array of urls.
+ `proxyAgent`: (HttpProxyAgent|HttpsProxyAgent) - instance of npm "hpagent" HttpProxyAgent or HttpsProxyAgent to be passed to npm "got"

@@ -83,0 +84,0 @@ ```javascript

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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