
Security News
New CNA Scorecard Tool Ranks CVE Data Quality Across the Ecosystem
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
fetch-rate-limit-util
Advanced tools
Handle fetch errors and rate limits and caching.
Waits and retry after rate limit rest time has reached.
import { stateActionHandler } from "fetch-rate-limit-util";
const response = await stateActionHandler(someURL, options);
// if rate limit occurs waits and retires
Type: Object
url
string? what to fetch nextrepeatAfter
number? of milliseconds to wait befor next trymessage
string? to reportdone
boolean op is finished returnresponse
Response postprocess
boolean exec postprocessFunction to provide progress report.
Type: Function
url
string to be requestedmethod
string http method namestatus
(string | Error) result of the last requestnthTry
number how often have we retriedExecutes fetch operation and handles response.
options
Object
Returns Promise<Response> from fetch
response
any Returns (number | undefined) msecs to wait
Waits and retries after rate limit reset time has reached.
Returns HandlerResult
Retry timeouts with increasing delay for each retry. Values in msecs.
Try several times with a increasing delay.
Returns HandlerResult
Redirect to given header location.
Returns HandlerResult
Postprocessing if response is ok.
Returns HandlerResult
No postprocessing.
Returns HandlerResult
Provide cached data.
Returns Promise<HandlerResult>
Minimum wait time in msecs.
Type: number
Max # of retries.
Type: number
Default options
With npm do:
npm install fetch-rate-limit-util
BSD-2-Clause
FAQs
handle fetch errors and rate limits
The npm package fetch-rate-limit-util receives a total of 365 weekly downloads. As such, fetch-rate-limit-util popularity was classified as not popular.
We found that fetch-rate-limit-util demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.