Socket
Socket
Sign inDemoInstall

chunk-store-stream

Package Overview
Dependencies
10
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.1 to 4.0.0

6

package.json
{
"name": "chunk-store-stream",
"description": "Convert an abstract-chunk-store compliant store into a readable or writable stream",
"version": "3.0.1",
"version": "4.0.0",
"author": {

@@ -15,3 +15,3 @@ "name": "Feross Aboukhadijeh",

"block-stream2": "^1.0.0",
"readable-stream": "^2.0.5"
"readable-stream": "^3.4.0"
},

@@ -25,3 +25,3 @@ "devDependencies": {

"standard": "*",
"string-to-stream": "^1.0.1",
"string-to-stream": "^2.0.0",
"tape": "^4.1.0"

@@ -28,0 +28,0 @@ },

@@ -15,2 +15,3 @@ const BlockStream = require('block-stream2')

this._blockstream = new BlockStream(chunkLength, { zeroPadding: false })
this._outstandingPuts = 0

@@ -20,3 +21,11 @@ let index = 0

if (this.destroyed) return
store.put(index, chunk)
this._outstandingPuts += 1
store.put(index, chunk, () => {
this._outstandingPuts -= 1
if (this._outstandingPuts === 0 && typeof this._finalCb === 'function') {
this._finalCb(null)
this._finalCb = null
}
})
index += 1

@@ -28,4 +37,2 @@ }

.on('error', err => { this.destroy(err) })
this.on('finish', () => this._blockstream.end())
}

@@ -37,2 +44,10 @@

_final (cb) {
this._blockstream.end()
this._blockstream.once('end', () => {
if (this._outstandingPuts === 0) cb(null)
else this._finalCb = cb
})
}
destroy (err) {

@@ -39,0 +54,0 @@ if (this.destroyed) return

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