Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

auto-retryer

hjmmc18MIT1.0.0

extend the automatic retry function for the Promise function

auto-retry, auto-retryer, promise-extend, retry, promise-retry, retry-library

readme

auto-retryer

extend the automatic retry function for the Promise function

Build Setup

# install dependencies
npm install auto-retryer --save

# node test
cd node_modules/auto-retryer
npm run test

Usage

const AutoRetryer = require('auto-retryer')
const _fetch = require('node-fetch')

//max retry 3 time
//sleep 300ms before retry
var fetch = new AutoRetryer(_fetch,3,300)

fetch('http://example.com',{method:'GET'}).then(ret=>{
    console.log('succcess',ret)
}).catch(err=>{
    console.log('err',err)
})