diff --git a/.gitignore b/.gitignore index b10b142..7e93d93 100755 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ # NodeModules node_modules +package-lock.json # Sitemap sitemap.xml \ No newline at end of file diff --git a/package.json b/package.json index 5db0574..aa33768 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-sitemap-generator", - "version": "1.0.1", + "version": "1.1.0", "description": "Create a XML sitemap for your website.", "main": "src/SitemapGenerator.js", "license": "MIT", @@ -22,7 +22,7 @@ "google" ], "dependencies": { - "cheerio": "^0.22.0", + "cheerio": "^1.0.0-rc.2", "moment": "^2.18.1", "simplecrawler": "^1.1.5", "url": "^0.11.0" @@ -34,4 +34,4 @@ "devDependencies": { "gulp": "*" } -} \ No newline at end of file +} diff --git a/src/SitemapGenerator.js b/src/SitemapGenerator.js index 8f8efac..4123628 100755 --- a/src/SitemapGenerator.js +++ b/src/SitemapGenerator.js @@ -20,7 +20,7 @@ const DEFAULT_OPTIONS = { onFetchComplete: function (urlItem, event) {}, onFetchError: function (queueItem, responseObject) {}, - onComplete: function (sitemap, items) {}, + onComplete: function (sitemap, queueItems) {}, filterFunction: function (urlItem) { return true } }; @@ -138,6 +138,10 @@ SitemapGenerator.prototype = { return sitemap; }, + /** + * @param {String} buffer + * @param {Object} queueItem + */ _discoverResources: function (buffer, queueItem) { var $ = cheerio.load(buffer.toString('utf8'));