2012-06-06 19:19:44 +00:00
|
|
|
(function () {
|
|
|
|
"use strict";
|
|
|
|
|
2013-06-23 06:19:24 +00:00
|
|
|
var walk = require('../lib/walk').walk
|
2014-01-27 02:08:15 +00:00
|
|
|
, path = require('path')
|
|
|
|
, dirname = process.argv[2] || './'
|
2012-06-06 19:19:44 +00:00
|
|
|
, walker
|
|
|
|
;
|
|
|
|
|
2014-01-27 02:08:15 +00:00
|
|
|
walker = walk(dirname);
|
|
|
|
|
2014-05-20 23:12:07 +00:00
|
|
|
walker.on('directories', function (root, stats, next) {
|
|
|
|
stats.forEach(function (stat) {
|
|
|
|
console.log('[ds]', path.join(root, stat.name));
|
|
|
|
});
|
|
|
|
next();
|
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
2014-01-27 02:08:15 +00:00
|
|
|
walker.on('directory', function (root, stat, next) {
|
|
|
|
console.log('[d]', path.join(root, stat.name));
|
|
|
|
next();
|
|
|
|
});
|
2014-05-20 23:12:07 +00:00
|
|
|
*/
|
2014-01-27 02:08:15 +00:00
|
|
|
|
2012-06-06 19:19:44 +00:00
|
|
|
walker.on('file', function (root, stat, next) {
|
2014-01-27 02:08:15 +00:00
|
|
|
console.log('[f]', path.join(root, stat.name));
|
2012-06-06 19:19:44 +00:00
|
|
|
next();
|
|
|
|
});
|
|
|
|
|
2014-01-27 02:08:15 +00:00
|
|
|
walker.on('end', function () {
|
|
|
|
console.log('All Done!');
|
|
|
|
});
|
2012-06-06 19:19:44 +00:00
|
|
|
}());
|