code: function copyDir(srcPath, desPath, relative) {
      if(relative == undefined){
          relative = srcPath;
      }
  
      fs.readdir(srcPath, function (err, files) {
          files.forEach(function (fileName) {
              fs.stat(path.join(srcPath, fileName), function (err, stats) {
                  if (err) {
                      console.log('[error] ', err);
                      return;
                  }
                  if (stats.isFile()) {
                      var relativePath = path.relative(relative, srcPath);
                      var replace = { win32: '..\\', linux: '../' };
  
                      var srcFile = path.normalize(srcPath + '/' + fileName);
                      var desFile = path.normalize(path.join(desPath,
                          relativePath.replace(replace[os.platform])) + '/' + fileName);
                      //console.log('src file:', srcFile);
                      //console.log('des file:', desFile);
                      createDir(srcFile,desFile);
  
                  } else if (stats.isDirectory()) {
                      //第三个参数用于区分是否是递归开始，并且计算目标路径相对于给定路径的相对位置
                      copyDir(path.join(srcPath,fileName),desPath,relative);
                  }
              });
          });
      });
  }
docs: 拷贝目录
  @param {*String} srcPath 需要拷贝的目录绝对路径
  @param {*String} desPath 目标绝对路径
  @param {*String} relative 调用时请忽略，函数内部区别是否递归开始