lib/capcon.js
function captureStdio(opts, exec) {
  var streams = [
    process.stdout,
    process.stderr
  ];

  var outputs = capture(streams, opts, exec);

  return {
    stdout: outputs.shift(),
    stderr: outputs.shift()
  };
}
function captureStdio(opts, exec) {
  var streams = [
    process.stdout,
    process.stderr
  ];

  var outputs = capture(streams, opts, exec);

  return {
    stdout: outputs.shift(),
    stderr: outputs.shift()
  };
}
Captures stdout and stderr into an object for
the provided execution scope.

@param opts to set flags on the capture.
@param exec the function execute inside the capture.
@returns {{stdout: String, stderr: String}}