All notable changes will be documented in this file.
readdir-enhanced adheres to Semantic Versioning.
Refactored the codebase to use ES6 syntax (Node v4.x compatible)
You can now provide your own implementation for the filesystem module that's used by readdir-enhanced. Just set the fs option to your implementation. Thanks to @mrmlnc for the idea and the PR!
Better error handling, especially around user-specified logic, such as options.deep, options.filter, and options.fs
fs.Stats objects now include a depth property, which indicates the number of subdirectories beneath the base path. Thanks to @mrmlnc for the PR!The deep option can now be set to a regular expression, a glob pattern, or a function, which allows you to customize which subdirectories get crawled. Of course, you can also still still set the deep option to true to crawl all subdirectories, or a number if you just want to limit the recursion depth.
The filter option can now be set to a regular expression or a glob pattern string, which simplifies filtering based on file names. Of course, you can still set the filter option to a function if you need to perform more advanced filtering based on the fs.Stats of each file.
As of this release, readdir-enhanced is fully tested on all major Node versions (0.x, 4.x, 5.x, 6.x) on linux and Windows, with nearly 100% code coverage. I do all of my local development and testing on MacOS, so that's covered too.