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

fetch-retry

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-retry - npm Package Compare versions

Comparing version 3.2.3 to 4.0.0

1

index.js
'use strict';
require('es6-promise').polyfill();

@@ -4,0 +3,0 @@ module.exports = function (fetch, defaults) {

2

package.json
{
"name": "fetch-retry",
"version": "3.2.3",
"version": "4.0.0",
"description": "Extend any fetch library with retry functionality",

@@ -5,0 +5,0 @@ "repository": "https://github.com/jonbern/fetch-retry.git",

@@ -7,3 +7,3 @@ # fetch-retry

[![Build Status](https://travis-ci.org/jonbern/fetch-retry.svg)](https://travis-ci.org/jonbern/fetch-retry)
[![Build Status](https://travis-ci.org/jonbern/fetch-retry.svg?branch=master)](https://travis-ci.org/jonbern/fetch-retry)

@@ -22,2 +22,4 @@ ## npm package

```javascript
require('es6-promise').polyfill();
var originalFetch = require('isomorphic-fetch');

@@ -51,2 +53,5 @@ var fetch = require('fetch-retry')(originalFetch);

> `fetch-retry` uses promises and requires you to polyfill the Promise API in order to support Internet Explorer.
## Example: Exponential backoff

@@ -53,0 +58,0 @@ The default behavior of `fetch-retry` is to wait a fixed amount of time between attempts, but it is also possible to customize this by passing a function as the `retryDelay` option. The function is supplied three arguments: `attempt` (starting at 0), `error` (in case of a network error), and `response`. It must return a number indicating the delay.

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

var expect = require('expectations');
var Promise = require('es6-promise');

@@ -986,2 +985,3 @@ describe('fetchBuilder', function () {

var resolve, reject;
// eslint-disable-next-line no-undef
var promise = new Promise(function () {

@@ -988,0 +988,0 @@ resolve = arguments[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