node.js fs.readdir recursive directory search
问题 Any ideas on an async directory search using fs.readdir? I realise that we could introduce recursion and call the read directory function with the next directory to read, but am a little worried about it not being async... Any ideas? I\'ve looked at node-walk which is great, but doesn\'t give me just the files in an array, like readdir does. Although Looking for output like... [\'file1.txt\', \'file2.txt\', \'dir/file3.txt\'] 回答1: There are basically two ways of accomplishing this. In an