runner5

Callback wrapper

npm install runner5
6 downloads in the last week
26 downloads in the last month

Runner5

Build Status

Running all of your functions.

Notes

Context is an optional argument

Error Example:

var Runner5 = require('runner5');

function test(arg1, cb) {
  // do something
  cb('BLAH!', null);
}

var context = {};

var runner = new Runner5(context, test)

runner.error(function(err) {
  console.log(err);
});

runner.run(4);

or

var Runner5 = require('runner5');

function test(arg1, cb) {
  // do something
  cb('BLAH!', null);
}

var context = {};

var runner = new Runner5(context, test)

runner.on('failure', function(err) {
  console.log(err);
});

runner.run(4);

Success Example:

var Runner5 = require('runner5');

function test(arg1, cb) {
  // do something
  cb(null, ['a', 'b']);
}

var context = {};

var runner = new Runner5(context, test)

runner.success(function(results) {
  console.log(results);
});

runner.run(4);

or

var Runner5 = require('runner5');

function test(arg1, cb) {
  // do something
  cb(null, ['a', 'b']);
}

var context = {};

var runner = new Runner5(context, test)

runner.on('success', function(results) {
  console.log(results);
});

runner.run(4);
npm loves you