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 3.0.1 to 3.1.0

1

index.d.ts

@@ -10,2 +10,3 @@ declare module 'retry-request' {

retries?: number,
noResponseRetries?: number,
shouldRetryFn?: (response: request.RequestResponse) => boolean

@@ -12,0 +13,0 @@ }

5

index.js

@@ -10,2 +10,3 @@ 'use strict';

retries: 2,
noResponseRetries: 2,
shouldRetryFn: function (response) {

@@ -59,4 +60,2 @@ var retryRanges = [

var MAX_NO_RESPONSE_RETRIES = 2;
var numAttempts = 0;

@@ -157,3 +156,3 @@ var numNoResponseAttempts = 0;

if (numNoResponseAttempts <= MAX_NO_RESPONSE_RETRIES) {
if (numNoResponseAttempts <= opts.noResponseRetries) {
retryAfterDelay(numNoResponseAttempts);

@@ -160,0 +159,0 @@ } else {

{
"name": "retry-request",
"version": "3.0.1",
"version": "3.1.0",
"description": "Retry a request.",

@@ -5,0 +5,0 @@ "main": "index.js",

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

#### `opts.noResponseRetries`
Type: `Number`
Default: `2`
The number of times to retry after a response fails to come through, such as a DNS resolution error or a socket hangup.
```js
var opts = {
noResponseRetries: 0
};
request(url, opts, function (err, resp, body) {
// url was requested 1 time before giving up and
// executing this callback.
});
```
#### `opts.objectMode`

@@ -45,0 +64,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