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 2.0.0 to 2.1.0

19

index.js

@@ -100,2 +100,16 @@ 'use strict'

this.resetTimer()
// To ensure that the write that caused this stream to be started
// is perfromed in the same tick, call the callback synchronously.
// Note that we can't do this in case the chopper is locked.
cb()
}
StreamChopper.prototype.resetTimer = function (time) {
if (arguments.length > 0) this.time = time
if (this._timer) {
clearTimeout(this._timer)
this._timer = null
}
if (this.time !== -1) {

@@ -108,7 +122,2 @@ this._timer = setTimeout(() => {

}
// To ensure that the write that caused this stream to be started
// is perfromed in the same tick, call the callback synchronously.
// Note that we can't do this in case the chopper is locked.
cb()
}

@@ -115,0 +124,0 @@

{
"name": "stream-chopper",
"version": "2.0.0",
"version": "2.1.0",
"description": "Chop a single stream of data into a series of readable streams",

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

"coordinates": [
55.777869,
12.592288
55.778001,
12.592357
]
}

@@ -130,3 +130,4 @@ # stream-chopper

Use this property to override it with a new value. The new value will
take effect when the next stream is initialized.
take effect when the next stream is initialized. To change the current
timer, see [`chopper.resetTimer()`](#chopperresettimertime).

@@ -161,2 +162,19 @@ Set to `-1` for no time limit.

### `chopper.resetTimer([time])`
Use this function to reset the current timer (configured via the `time`
config option). Calling this function will force the current timer to
start over.
If the optional `time` argument is provided, this value is used as the
new time. This is equivilent to calling:
```js
chopper.time = time
chopper.resetTimer()
```
If the function is called with `time` set to `-1`, the current timer is
cancelled and the time limit is disabled for all future streams.
## License

@@ -163,0 +181,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