exec-retry
v2.1.0
Published
child_process#exec with retry on failure
Downloads
111
Readme
exec-retry
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
$ make test
License
MIT © Vadym Demedes