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

retry-request

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

retry-request - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

8

index.js
'use strict';
var through = require('through2');
var debug = require('debug')('retry-request');

@@ -25,2 +26,3 @@ var DEFAULTS = {

var statusCode = response.statusCode;
debug(`Response status: ${statusCode}`);

@@ -121,2 +123,3 @@ var range;

currentRetryAttempt++;
debug(`Current retry attempt: ${currentRetryAttempt}`);

@@ -166,3 +169,6 @@ if (streamMode) {

setTimeout(makeRequest, getNextRetryDelay(currentRetryAttempt));
var nextRetryDelay = getNextRetryDelay(currentRetryAttempt);
debug(`Next retry delay: ${nextRetryDelay}`);
setTimeout(makeRequest, nextRetryDelay);
}

@@ -169,0 +175,0 @@

10

package.json
{
"name": "retry-request",
"version": "4.0.0",
"version": "4.1.0",
"description": "Retry a request.",

@@ -24,13 +24,13 @@ "main": "index.js",

"engines": {
"node": ">=4"
"node": ">=8.10.0"
},
"dependencies": {
"through2": "^2.0.0"
"through2": "^3.0.1"
},
"devDependencies": {
"async": "^2.5.0",
"async": "^3.0.1",
"lodash.range": "^3.2.0",
"mocha": "^2.2.5",
"mocha": "^6.1.4",
"request": "^2.87.0"
}
}

@@ -50,2 +50,8 @@ |![retry-request](logo.png)

## Can I monitor what retry-request is doing internally?
Yes! This project uses [debug](https://www.npmjs.com/package/debug) to provide the current retry attempt, each response status, and the delay computed until the next retry attempt is made. To enable the debug mode, set the environment variable `DEBUG` to *retry-request*.
(Thanks for the implementation, @yihaozhadan!)
## request(requestOptions, [opts], [cb])

@@ -52,0 +58,0 @@

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