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

promise-ratelimit

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise-ratelimit

Rate limiting (throttling) implementation for ES6 Promises

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

promise-ratelimit

NPM Version NPM Downloads Build Status Coverage Status Dependency Status devDependency Status

Rate limiting (throttling) implementation for Promises on Node.js

Install: npm install promise-ratelimit

Limit frequency of promise fulfilling:

var throttle = require('promise-ratelimit')(2000); /* rateInMilliseconds */

var startTime = Date.now();

for (var i = 0; i < 10; i++) {
	throttle().then(function() { console.log(Date.now() - startTime); });
}

// example output:
// 11
// 2007
// 4007
// 6008
// 8011
// 10014
// 12016
// 14018
// 16020
// 18022

License

MIT

Note: q-ratelimit and promise-ratelimit are sister modules based on the same original code.

FAQs

Package last updated on 15 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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