sudsy / node-find-files

A Node Module for finding files by attributes. Originally developed to find files modified since a particular date. Uses an eventemitter model so the results can start streaming back as soon as they are found.
15 stars 7 forks source link

Error if no filterFunction option is added. #3

Closed ruimarques closed 4 years ago

ruimarques commented 9 years ago

If you call finder the following way, you get 'undefined is not a function' errors for every file match, because there is no default filterFunction and the code assumes such function was set in the options.

 var finder = new FindFiles({
        rootFolder: "/home"
 });

If, for example, the filterFunction is set like this, everything works fine:

var finder = new FindFiles({
                rootFolder: "/home",
                filterFunction: function () {
                    return true;
                }
 });
sudsy commented 4 years ago

Fixed with 1.0.0 release