kosmtik-fetch-remote
Advanced tools
Comparing version 0.0.3 to 0.0.4
var fs = require('fs'), | ||
path = require('path'), | ||
http = require('http'), | ||
unzip = require('unzip'); | ||
@@ -20,2 +19,3 @@ | ||
force = this.config.parsed_opts['force-fetch-remote'], | ||
self = this, | ||
incr = function () { | ||
@@ -67,3 +67,4 @@ processed++; | ||
}; | ||
http.get(uri, function onResponse (resp) { | ||
var onResponse = function (resp) { | ||
if (resp.statusCode >= 400) return onError(new Error('Bad status code: ' + resp.statusCode)); | ||
var file = fs.createWriteStream(dest); | ||
@@ -74,3 +75,4 @@ resp.pipe(file); | ||
}); | ||
}).on('error', onError); | ||
}; | ||
self.config.helpers.request({uri: uri}).on('error', onError).on('response', onResponse); | ||
}; | ||
@@ -77,0 +79,0 @@ incr(); |
{ | ||
"name": "kosmtik-fetch-remote", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Kosmtik plugin to fetch remote layer data", | ||
@@ -23,3 +23,3 @@ "main": "index.js", | ||
}, | ||
"kosmtik": "~0.0.2" | ||
"kosmtik": "~0.0.6" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
3859
83
0