Socket
Socket
Sign inDemoInstall

buffered-xhr-stream

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

5

foo.js

@@ -12,7 +12,2 @@ var Stream = require('./index')

// stream.on('data', function (d) {
// if (++count % 10 ==0) {
// stream.pause()
// }
// })
stream.pipe(JSONStream.parse(['rows', true])).on('data', function (d) {

@@ -19,0 +14,0 @@ if (++count % 50 == 0) {

11

index.js

@@ -29,2 +29,8 @@ var stream = require('stream')

}
} else if (this.xhr.readyState === 4) {
flush(this)
if (this.xhr.error) {
this.emit('error')
}
}

@@ -52,3 +58,3 @@ }

if (stream.xhr.readyState === 4 && stream.offset === stream.xhr.responseText.length) {
if (stream.offset === stream.xhr.responseText.length) {
stream.emit('end')

@@ -67,5 +73,2 @@ }

Stream.prototype.resume = function () {
if (this._state !== 'paused') {
return
}
this._state = 'flowing'

@@ -72,0 +75,0 @@ flush(this)

{
"name": "buffered-xhr-stream",
"version": "0.1.0",
"version": "0.1.1",
"description": "A pausable/resumable xhr stream",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc