🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

exec-retry

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exec-retry

child_process#exec with retry on failure

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
46
39.39%
Maintainers
1
Weekly downloads
 
Created
Source

exec-retry Circle CI

child_process.exec with a retry functionality using retry.

Features

  • Retry a command until success
  • Set retry options (see retry)
  • It even returns streams, just like node's exec, oh wow

Installation

$ npm install exec-retry --save

Usage

const exec = require('exec-retry');

exec('curl https://www.roqet.io', function (err, stdout, stderr) {
  // done!
});


// now set max retries number
exec.timeouts = {
  retries: 3
};

exec('curl https://www.roqet.io', function (err, stdout, stderr) {
  // fails after 3 retries
});


// and streams!
let ps = exec('ping google.com', function () {
  // done!
});

ps.stdout.on('data', function (data) {
  // stream output
});

Tests

Circle CI

$ make test

License

exec-retry is released under the MIT license.

Keywords

exec

FAQs

Package last updated on 30 Jul 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