fileiterator
v0.1.1
Published
small file iterator utility
Downloads
5
Readme
fileiterator
The responsibility of this module that is finding file and directory recursively.
You can new FileIterator Class, then call findFile Function property with two arguments.
First arg is an array of paths, second arg is callback(err, result).You also can add
'file' or 'directory' event listener. eg: obj.on("file", function(path, stat){}).
eg:
var FileIterator = require('fileiterator');
var obj = new FileIterator();
obj.on('file', function(path, stat){
console.log('file path = %s', path);
});
obj.on('directory', function(path, stat){
console.log('directory stat = %s', JSON.stringify(stat));
});
obj.findFile(['./test'], function(err, result){
if(err){
console.log(err);
}else{
console.log("files = %s", result);
}
})
##Install Just run npm install fileiterator