SILENT KILLERPanel

Current Path: > > lib > node_modules > npm > node_modules > call-limit


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //lib/node_modules/npm/node_modules/call-limit

NameTypeSizeLast ModifiedActions
CHANGELOG.md File 619 bytes March 10 2021 14:36:38.
LICENSE File 723 bytes March 10 2021 14:36:38.
README.md File 2176 bytes March 10 2021 14:36:38.
call-limit.js File 2755 bytes March 10 2021 14:36:38.
package.json File 1957 bytes March 10 2021 14:36:38.

Reading File: //lib/node_modules/npm/node_modules/call-limit/README.md

call-limit
----------

Limit the number of simultaneous executions of a async function.

```javascript
const fs = require('fs')
const limit = require('call-limit')
const limitedStat = limit(fs.stat, 5)
```

Or with promise returning functions:

```javascript
const fs = Bluebird.promisifyAll(require('fs'))
const limit = require('call-limit')
const limitedStat = limit.promise(fs.statAsync, 5)
```

### USAGE:

Given that:

```javascript
const limit = require('call-limit')
```

### limit(func, maxRunning) → limitedFunc

The returned function will execute up to maxRunning calls of `func` at once. 
Beyond that they get queued and called when the previous call completes.

`func` must accept a callback as the final argument and must call it when
it completes, or `call-limit` won't know to dequeue the next thing to run.

By contrast, callers to `limitedFunc` do NOT have to pass in a callback, but
if they do they'll be called when `func` calls its callback.

### limit.promise(func, maxRunning) → limitedFunc

The returned function will execute up to maxRunning calls of `func` at once.
Beyond that they get queued and called when the previous call completes.

`func` must return a promise.

`limitedFunc` will return a promise that resolves with the promise returned
from the call to `func`.

### limit.method(class, methodName, maxRunning)

This is sugar for:

```javascript
class.prototype.methodName = limit(class.prototype.methodName, maxRunning)
```

### limit.method(object, methodName, maxRunning)

This is sugar for:

```javascript
object.methodName = limit(object.methodName, maxRunning)
```

For example `limit.promise.method(fs, 'stat', 5)` is the same as
`fs.stat = limit.promise(fs.stat, 5)`.

### limit.promise.method(class, methodName, maxRunning)

This is sugar for:

```javascript
class.prototype.methodName = limit.promise(class.prototype.methodName, maxRunning)
```

### limit.promise.method(object, methodName, maxRunning)

This is sugar for:

```javascript
object.methodName = limit.promise(object.methodName, maxRunning)
```

For example `limit.promise.method(fs, 'statAsync', 5)` is the same as
`fs.statAsync = limit.promise(fs.statAsync, 5)`.

SILENT KILLER Tool