docs: function exec() {
      var argv = _spawnArgs(arguments),
          cmd = argv[0],
          args = argv[1],
          options = argv[2],
          done = argv[3],
          out = [],
          err = [],
          count = 0,
          pipeout = emptyFn,
          pipeerr = emptyFn,
          child, stdout, stderr, stdio;
  
      stdio = options.stdio || 'pipe';
      options.stdio = ['pipe', 'pipe', 'pipe'];
  
      if (Array.isArray(stdio)) {
          options.stdio[0] = stdio[0];
      } else if ('string' === typeof stdio) {
          options.stdio[0] = stdio;
      }
  
      if (stdio === 'inherit' || stdio[1] === 'inherit' || stdio[1] === 1 || stdio[1] === process.stdout) {
          pipeout = function(chunk) {
              process.stdout.write(chunk);
          };
      }
  
      if (stdio === 'inherit' || stdio[2] === 'inherit' || stdio[2] === 2 || stdio[2] === process.stderr) {
          pipeerr = function(chunk) {
              process.stderr.write(chunk);
          };
      }
  
      child = _spawn(cmd, args, options);
  
      count++;
      child.on('close', end);
  
      function end(code, signal) {
          if (code) {
              out.code = code;
          }
  
          if (--count === 0) {
              var output = out.join('');
              var error = err.join('');
  
              if (code === 0 && error.length === 0) {
                  done(null, output, out.code);
              } else {
                  done(error, output, out.code);
              }
          }
      }
  
      count++;
      child.stdout.on('data', function(chunk) {
          out.push(chunk);
          pipeout(chunk);
      });
      child.stdout.on('end', end);
  
      count++;
      child.stderr.on('data', function(chunk) {
          err.push(chunk);
          pipeerr(chunk);
      });
      child.stderr.on('end', end);
  
      return child;
  }