我想找到所有的*.html文件在src文件夹和它的所有子文件夹使用nodejs。做这件事最好的方法是什么?
var folder = '/project1/src';
var extension = 'html';
var cb = function(err, results) {
// results is an array of the files with path relative to the folder
console.log(results);
}
// This function is what I am looking for. It has to recursively traverse all sub folders.
findFiles(folder, extension, cb);
我认为许多开发人员应该有很好的和经过测试的解决方案,使用它比我自己写一个要好。
https://stackoverflow.com/questions/25460574
复制相似问题