- dir directory path;
- options
- hidden list hidden files (started with
.
); - ext list only files with the provided extension;
- nonregular list non regular files such as devices or sockets;
- hidden list hidden files (started with
- callback
function (err, file)
,file
will be a relative path of the found file to the given directory path;
- Hidden and non regular files are not listed by default;
- The callback is called for each found file (realize that it's called multiple times).