exec-retry

child_process#exec with retry on failure

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
exec-retry
102.1.09 years ago9 years agoMinified + gzip package size for exec-retry in KB

Readme

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
  • Uses debug to log useful information

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('curl https://www.roqet.io', { retries: 3 }, 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

MIT © Vadym Demedes