buffered-xhr-stream
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -20,2 +20,3 @@ var stream = require('stream') | ||
this.capable = true | ||
this.downloaded = false | ||
@@ -41,6 +42,7 @@ this.xhr = options.xhr | ||
} else if (this.xhr.readyState === 4) { | ||
flush(this) | ||
if (this.xhr.error) { | ||
this.emit('error') | ||
} else { | ||
this.downloaded = true | ||
flush(this) | ||
} | ||
@@ -63,3 +65,4 @@ } | ||
} | ||
while (stream.xhr.responseText.length - stream.offset >= stream.chunkSize && stream._state === 'flowing') { | ||
while (stream._state === 'flowing' && stream.xhr.responseText.length - stream.offset != 0 && | ||
(stream.downloaded || stream.xhr.responseText.length - stream.offset >= stream.chunkSize)) { | ||
var chunk = stream.xhr.responseText.substr(stream.offset, stream.chunkSize) | ||
@@ -66,0 +69,0 @@ stream.emit('data', chunk) |
{ | ||
"name": "buffered-xhr-stream", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "A pausable/resumable xhr stream", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "testling -x open" | ||
}, | ||
@@ -24,3 +24,12 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/SpiderStrategies/node-buffered-xhr-stream" | ||
"homepage": "https://github.com/SpiderStrategies/node-buffered-xhr-stream", | ||
"devDependencies": { | ||
"tape": "^2.13.3", | ||
"testling": "^1.6.1", | ||
"concat-stream": "^1.4.6" | ||
}, | ||
"testling": { | ||
"files": "test/test.js", | ||
"server": "test/server.js" | ||
} | ||
} |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
4877
6
117
1
3
1
1