🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

f-throttle

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

f-throttle

Limit concurrency of a function returning a promise.

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
10
42.86%
Maintainers
1
Weekly downloads
 
Created
Source

f-throttle Build Status Dependency Status

Limit concurrency of a function returning a promise.

Usage

var throttle = require("f-throttle")
var throttledFn = throttle(concurrency, anyFn)

throttleFn functions like anyFn, but throttled to a concurrency of concurrency, where concurency is a number equal or higher than one.

Notes

  • throttledFn returns a promise.
  • anyFn must return a promise. If it does not, the promise returned by throttledFn will be rejected.
  • You may pass any number of arguments
  • Function context is preserved, so can work for when throttling a function that's a method for an object.
  • When you throttle a function to a concurrency of 1, this results in execution in a serial fashion.

Credits

The initial structure of this module was generated by Jumpstart, using the Jumpstart Black Coffee template.

License

f-throttle is released under the MIT License.
Copyright (c) 2013 Meryn Stol

Keywords

throttle

FAQs

Package last updated on 30 May 2013

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