Socket
Socket
Sign inDemoInstall

leaky-bucket

Package Overview
Dependencies
0
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.1.2 to 4.1.3

2

package.json
{
"name": "leaky-bucket",
"description": "A fast and efficient leaky bucket implementation",
"version": "4.1.2",
"version": "4.1.3",
"homepage": "https://github.com/linaGirl/leaky-bucket",

@@ -6,0 +6,0 @@ "author": "Lina van der Weg <lina@vanderweg.ch> (http://vanderweg.ch/)",

@@ -225,3 +225,2 @@ # leaky-bucket

interval: 60,
idleTimeout: 2000,
});

@@ -247,4 +246,2 @@

interval: 60,
idleTimeout: 2000,
});

@@ -259,5 +256,26 @@ bucket.on('idle', (bucketInstance) => {

### bucket.off(eventName, optional handler)
Removes all or one listeners for an event
```javascript
const bucket = new Bucket({
capacity: 60,
interval: 60,
});
// remove all listeners for the idle event
bucket.off('idle')
const listener = (bucketInstance) => {
console.log(bucketInstance.getCurrentCapacity());
}
bucket.on('idle', listener);
// remove one specific listener
bucket.off('idle', listener);
````
## Browser

@@ -264,0 +282,0 @@

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