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

stream-chopper

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-chopper - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

17

index.js

@@ -60,2 +60,10 @@ 'use strict'

StreamChopper.prototype.chop = function (cb) {
if (this._destroyed) {
if (cb) process.nextTick(cb)
return
}
this._endStream(cb)
}
StreamChopper.prototype._startStream = function (cb) {

@@ -104,3 +112,6 @@ if (this._destroyed) return

if (this._destroyed) return
if (this._stream === null) return process.nextTick(cb)
if (this._stream === null) {
if (cb) process.nextTick(cb)
return
}

@@ -115,3 +126,3 @@ const stream = this._stream

stream.end(cb)
} else {
} else if (cb) {
process.nextTick(cb)

@@ -198,3 +209,3 @@ }

})
stream.destroy() // TODO: Should I listen for `error` even though I'm not passing in an error to destroy()?
stream.destroy()
} else {

@@ -201,0 +212,0 @@ this.emit('close')

6

package.json
{
"name": "stream-chopper",
"version": "1.0.0",
"version": "1.1.0",
"description": "Chop a single stream of data into a series of readable streams",

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

"coordinates": [
55.777379,
12.592166
55.777427,
12.592209
]
}

@@ -116,2 +116,12 @@ # stream-chopper

### `chopper.chop([callback])`
Manually chop the stream. Forces the current output stream to end even
if its `size` limit or `time` timeout hasn't been reached yet.
Arguments:
- `callback` - An optional callback which will be called once the output
stream have ended
## License

@@ -118,0 +128,0 @@

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