Registry / testing / limit-request-promise

limit-request-promise

JSON →
library0.1.2jsnpmunverified

A rate-limited HTTP request library for Node.js built on top of request-promise. Version 0.1.2 is the only release, with no updates since. It provides per-domain request throttling with configurable max requests per time window. Unlike generic rate-limiters, it integrates directly with request-promise and manages request queues automatically. The library is lightweight but depends on the deprecated request package. Not recommended for new projects due to reliance on deprecated dependencies and lack of maintenance.

npm install limit-request-promise
INSTALL
IMPORT
SIG · LIMIT-REQUEST-PROM
L
limit-request-promise
testingjavascriptv0.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LimitRequestPromise
const LimitRequestPromise = require('limit-request-promise')
import LimitRequestPromise from 'limit-request-promise'
Package only supports CommonJS require. ESM import will fail.
default export
const LimitRequestPromise = require('limit-request-promise')
const { LimitRequestPromise } = require('limit-request-promise')
The module exports a single constructor directly, not an object.
constructor options
const lp = new LimitRequestPromise(1, 1)
const lp = new LimitRequestPromise({max:1, sec:1})
Constructor takes two numeric arguments (max concurrency, delay in seconds), not an options object.

Creates a rate-limited request instance, configures per-domain limits, and sends a request.

const LimitRequestPromise = require('limit-request-promise'); const lp = new LimitRequestPromise(2, 1); // max 2 concurrent, 1 second delay lp.setup([ { host: 'http://www.example.com', max: 1000, sec: 60 } ]); lp.req('http://www.yahoo.co.jp') .then(console.log) .catch(console.error);
Debug
Known issues
deprecatedThis package depends on 'request-promise', which depends on the deprecated 'request' library. 'request' is no longer maintained and has known security issues.
fix
Use modern alternatives like 'got', 'axios', or 'node-fetch' with a rate-limiting wrapper.
affects: >=0.0.0
gotchaConstructor expects two numeric arguments: (maxConcurrency, delaySeconds). Passing an object or incorrect types may cause unexpected behavior.
fix
Use 'new LimitRequestPromise(2, 1)' for 2 concurrent requests with 1-second delay.
affects: >=0.0.0
gotchaThe 'setup' method must be called with an array of objects containing host, max, and sec properties. Missing or incorrect properties will cause errors.
fix
Call 'lp.setup([{ host: 'http://example.com', max: 1000, sec: 60 }])'.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: LimitRequestPromise is not a constructor
Using ES module import instead of CommonJS require.
fix
Use 'const LimitRequestPromise = require('limit-request-promise')'.
Error: Cannot find module 'request-promise'
Peer dependency 'request-promise' not installed.
fix
Run 'npm install request-promise'.
TypeError: lp.setup is not a function
Calling setup before creating an instance or misspelling method name (e.g., set up).
fix
Ensure you create an instance: 'const lp = new LimitRequestPromise(1,1); lp.setup([...])'.
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies
request-promiserequiredcore dependency for HTTP requests
bluebirdrequiredpromise library used by request-promise
Agent activity
2 hits · last 30 days
node
2
Resources
limit-request-promise — npm install limit-request-promise · libregistry