Comparing version 1.8.1 to 1.8.2
// Generated by CoffeeScript 1.3.1 | ||
(function() { | ||
var balUtilFlow, balUtilPaths, fsUtil, pathUtil, request, | ||
var balUtilFlow, balUtilPaths, fsUtil, pathUtil, | ||
__slice = [].slice, | ||
@@ -15,4 +15,2 @@ __hasProp = {}.hasOwnProperty; | ||
request = null; | ||
if (global.numberOfOpenFiles == null) { | ||
@@ -579,12 +577,17 @@ global.numberOfOpenFiles = 0; | ||
readPath: function(filePath, next) { | ||
var _this = this; | ||
var http, requestOptions; | ||
if (/^http/.test(filePath)) { | ||
if (!request) { | ||
request = require('request'); | ||
} | ||
request(filePath, function(err, response, data) { | ||
if (err) { | ||
return typeof next === "function" ? next(err) : void 0; | ||
} | ||
return typeof next === "function" ? next(null, data) : void 0; | ||
requestOptions = require('url').parse(filePath); | ||
http = requestOptions.protocol === 'https:' ? require('https') : require('http'); | ||
http.get(requestOptions, function(res) { | ||
var data; | ||
data = ''; | ||
res.on('data', function(chunk) { | ||
return data += chunk; | ||
}); | ||
return res.on('end', function() { | ||
return typeof next === "function" ? next(null, data) : void 0; | ||
}); | ||
}).on('error', function(err) { | ||
return typeof next === "function" ? next(err) : void 0; | ||
}); | ||
@@ -591,0 +594,0 @@ } else { |
{ | ||
"name": "bal-util", | ||
"version": "1.8.1", | ||
"version": "1.8.2", | ||
"description": "Common utility functions for Node.js used and maintained by Benjamin Lupton", | ||
@@ -38,5 +38,2 @@ "homepage": "https://github.com/balupton/bal-util", | ||
}, | ||
"optionalDependencies": { | ||
"request": "2.9.x" | ||
}, | ||
"devDependencies": { | ||
@@ -43,0 +40,0 @@ "coffee-script": "1.3.x", |
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
103904
0
1691
4