+
95
-

nodejs如何比较两个文件夹内文件的差异与不同?

nodejs如何比较两个文件夹内文件的差异与不同?


网友回复

+
15
-
const fs = require('fs');
const path = require('path');

// 两个要比较的文件夹路径
const folder1Path = 'path_to_folder1';
const folder2Path = 'path_to_folder2';

// 获取文件夹中的文件列表
function getFilesInFolder(folderPath) {
  return fs.readdirSync(folderPath);
}

// 比较两个文件夹中的文件
function compareFolde...

点击查看剩余70%

我知道答案,我要回答