JSPM

  • Created
  • Published
  • Downloads 49456
  • Score
    100M100P100Q142932F
  • License MIT

Package Exports

  • ts-retry

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ts-retry) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ts-retry

A little retry tool in javascript/typescript for node.

API

  • retry(fn, retryOptions): call repeteadly fn until fn does not throw and exception. Stop after retryOptions.maxTry count. Between each call wait retryOptions.delay milliseconds. if stop to call fn after retryOptions.maxTry, throws fn execption, otherwise returns fn return value.
  • retryAsync(fn, retryOptions): same as retry, except fn is an asynchronous function.
  • retryOptions:
    • maxTry maximum calls to fn.
    • delay: delay between each call (in milliseconds).