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

leaky-bucket

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaky-bucket - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

2

package.json
{
"name" : "leaky-bucket"
, "description" : "A fast and efficient leaky bucket implementation"
, "version" : "0.1.6"
, "version" : "0.1.7"
, "homepage" : "https://github.com/eventEmitter/leaky-bucket"

@@ -6,0 +6,0 @@ , "author" : "Michael van der Weg <michael@joinbox.com> (http://joinbox.com/)"

@@ -25,3 +25,3 @@ # leaky-bucket

var instance = new LeakyBucket([RequestsPerInterval = 60][, Interval = 60]);
var instance = new LeakyBucket([ItemsPerInterval = 60][, Interval = 60]);

@@ -34,3 +34,3 @@

Create a new leaky bucket which is allowed to execute 120 items every 30 seconds
Create a new leaky bucket which is allowed to execute 200 items every 30 seconds

@@ -75,9 +75,15 @@ var bucket = new LeakyBucket(200, 30);

var bucket = new LeakyBucket(60);
var LeakyBucket = require('leaky-bucket')
, request = require('request')
, bucket;
// create bucket instance, 60 request per minute
bucket = new LeakyBucket(60);
// this will throttle request if required
bucket.throttle(function() {
// execute request
// execute request using the request module
request({

@@ -84,0 +90,0 @@ method: 'get'

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