From a91f404fc7acbc776ac7baabb170edb9adf3796e Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 20 May 2014 17:12:07 -0600 Subject: [PATCH] forEachAsync ~2.2 -> foreachasync 3.x --- lib/walk.js | 5 +---- package.json | 4 ++-- test/test-walk.js | 9 +++++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/walk.js b/lib/walk.js index e06d77c..8e091df 100644 --- a/lib/walk.js +++ b/lib/walk.js @@ -2,13 +2,10 @@ (function () { "use strict"; - // Array.prototype.forEachAsync(next, item, i, collection) - //require('Array.prototype.forEachAsync'); - function noop() {} var fs = require('fs') - , forEachAsync = require('forEachAsync') + , forEachAsync = require('foreachasync').forEachAsync , EventEmitter = require('events').EventEmitter , TypeEmitter = require('./node-type-emitter') , util = require('util') diff --git a/package.json b/package.json index 9812e7c..97e7d4b 100644 --- a/package.json +++ b/package.json @@ -13,11 +13,11 @@ "author": "AJ ONeal ", "contributors": [], "dependencies": { - "forEachAsync": "~2.2" + "foreachasync": "3.x" }, "lib": ".", "main": "./lib/walk.js", - "version": "2.3.1", + "version": "2.3.2", "repository": { "url": "git://github.com/coolaj86/node-walk.git" }, diff --git a/test/test-walk.js b/test/test-walk.js index 540ecc4..65c725c 100644 --- a/test/test-walk.js +++ b/test/test-walk.js @@ -9,10 +9,19 @@ walker = walk(dirname); + walker.on('directories', function (root, stats, next) { + stats.forEach(function (stat) { + console.log('[ds]', path.join(root, stat.name)); + }); + next(); + }); + + /* walker.on('directory', function (root, stat, next) { console.log('[d]', path.join(root, stat.name)); next(); }); + */ walker.on('file', function (root, stat, next) { console.log('[f]', path.join(root, stat.name));