Recursively walk directory trees. Think /usr/bin/find
.
require('findit').find(__dirname, function (file) {
console.log(file);
})
var finder = require('findit').find(__dirname);
finder.on('directory', function (dir) {
console.log(dir + '/');
});
finder.on('file', function (file) {
console.log(file);
});
var files = require('findit').findSync(__dirname);
console.dir(files);
Do an asynchronous recursive walk starting at basedir
.
Optionally supply a callback that will get the same arguments as the path event
documented below in "events".
Returns an EventEmitter. See "events".
Return an array of files and directories from a recursive walk starting at
basedir
.
Emitted for just files which are not directories.
Emitted for directories.
Emitted for both files and directories.
Emitted when the recursive walk is done.