Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

buffered-xhr-stream

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buffered-xhr-stream - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

test/server.js

9

index.js

@@ -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"
}
}
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