walkdir
Version:
Find files simply. Walks a directory tree emitting events based on what it finds. Presents a familiar callback/emitter/a+sync interface. Walk a tree of any depth.
19 lines (14 loc) • 386 B
JavaScript
var test = require('tape')
var walkdir = require('../')
test('async events',function(t){
var paths = [],
files = [],
dirs = [];
var emitter = walkdir(__dirname+'/dir/foo',function(path){
paths.push(path.replace(__dirname+'/',''));
}).ignore(__dirname+'/dir/foo');
emitter.on('end',function(){
t.equals(paths.length,0,'should have no paths')
t.end();
})
})