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

rerun

Package Overview
Dependencies
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rerun

A retry library for node.js

  • 1.1.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27
decreased by-55%
Maintainers
3
Weekly downloads
 
Created
Source

rerun Build Status

A retry library for node.js.
Rerun supports promises and request.js, as you will see, the API is pretty simple.

The options and their defaults for rerun library are:

{
  retries: 3
  retryTimeout: 50
  retryFactor: 1
}
  • retries - How many times to retry before failing.
  • retryTimeout - The initial time to wait (in milliseconds) before each retry.
  • retryFactor - The multiplier after each fail to multiply retryTimeout with.

Request

Rerun use with request is the same as with request itself, but with promises.

  var request = require('rerun').request;
  var promise = request({method:'POST', url: 'http://localhost/test', retries: 2, retryTimeout: 10, retryFactor: 2});

Promise

Rerun with promises is easy too, all you need is to call the library with the function you want to retry, and if it fails, the library will try again.
Notice that if you don't want the library to retry, you can throw require('rerun').RejectError.

  var retry = require('rerun').promise;
  var promise = retry(function () { doSomething(); }, { retries: 2, retryTimeout: 10, retryFactor: 2 });

Keywords

FAQs

Package last updated on 06 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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