make-retryable

1.0.1 • Public • Published

Travis CI dependencies Status Coverage Status js-standard-style

Make Retryable

Makes your function retryable

16 LOC, 100% test coverage, no deps

Installation

npm install make-retryable

Usage

;(async () => {
  const makeRetryable = require('make-retryable')
  const attempts = 2
 
  const retryable = makeRetryable(fn, attempts /* defauts to 3 */)
 
  // Will retry until the promise resolves or attempts reaches zero
  await retryable('https://alz.io')
 
  // Respects input arguments and return values
  console.log(await retryable(1, 2, 3) === await retryable(1, 2, 3)) // true
})()

Package Sidebar

Install

npm i make-retryable

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

3.83 kB

Total Files

5

Last publish

Collaborators

  • alz