example of walk3

This commit is contained in:
AJ ONeal 2010-12-11 23:47:03 -07:00
parent 6bcf64a422
commit d7c93fe195
1 changed files with 23 additions and 0 deletions

23
examples/find.js Normal file
View File

@ -0,0 +1,23 @@
(function () {
var walk = require("../lib/walk3.js"),
emit = walk(process.argv[2] || "/tmp");
//icount = 0;
emit.on('directory', function (path, file, next) {
//icount += 1;
console.log(path + '/' + file.name); // + " " + icount);
process.nextTick(next);
//setTimeout(next, 100);
});
/*
emit.on('file', function (path, file, next) {
console.log("FILE:", file.name, "\n");
next();
});
emit.on('directory', function (path, dir, next) {
console.log("DIR:", dir.name, "\n");
next();
});
*/
}());