Socket
Socket
Sign inDemoInstall

speed-limiter

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

speed-limiter - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

10

lib/throttle.js

@@ -32,10 +32,10 @@ const { Transform } = require('stream')

while (slice.length) {
// Stop pushing chunks if rate is zero
while (this.group.getRate() === 0) {
await wait(1 * 1000) // 1 second
}
try {
// Check here again because we might be in the middle of a big chunk
if (this.enabled && this.group.enabled) {
// Stop pushing chunks if rate is zero
while (this.group.getRate() === 0) {
await wait(1 * 1000) // 1 second
}
await new Promise((resolve, reject) => {

@@ -42,0 +42,0 @@ this.group.bucket.removeTokens(slice.length, (err) => {

{
"name": "speed-limiter",
"version": "0.1.3",
"version": "0.1.4",
"description": "Throttle the speed of streams",

@@ -5,0 +5,0 @@ "main": "index.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