code: function spawnSeries(commands, options, callback, done) {
      var i = -1,
          _len = commands.length;
  
      switch (arguments.length) {
          case 1:
              options = {};
              callback = emptyFn;
              done = emptyFn;
              break;
          case 2:
              if (isFunction(options)) {
                  done = options;
                  options = {};
              } else {
                  done = emptyFn;
              }
              callback = emptyFn;
              break;
          case 3:
              if (isFunction(callback)) {
                  done = callback;
                  callback = emptyFn;
              }
              break;
      }
  
      iterate(0);
  
      function iterate(err) {
          var child, cmd, argv, args, opts, next;
          if (!err && ++i < _len) {
              cmd = commands[i];
              if (Array.isArray(cmd)) {
                  argv = _spawnArgs(cmd, options);
                  cmd = argv[0];
                  args = argv[1];
                  opts = argv[2];
                  next = argv[3];
                  child = _spawn(cmd, args, opts, next);
              } else if (isFunction(cmd)) {
                  cmd(iterate);
                  callback(cmd, child, opts, i);
                  return;
              } else {
                  opts = getOptions(options);
                  child = _spawn(cmd, null, opts, emptyFn);
              }
              child.once('exit', iterate);
              callback(cmd, child, opts, i);
          } else {
              done(err);
          }
      }
  }
docs: Spawn commands in series
  Usage
  spawnSeries(Array commands)
  spawnSeries(Array commands, Object options)
  spawnSeries(Array commands, Function done)
  spawnSeries(Array commands, Object options, Function done)
  spawnSeries(Array commands, Object options, Function callback, Function done)
  @param  {Array}    commands commands to execute. If command is an array, it will be considered as arguments of spawn
  @param  {Object}   options  child process spawn options.
  @param  {Function} callback called with arguments (cmd, child, options, index)
  @param  {Function} done     called with arguments (error)