Gerard - Graceful Recursive ReadDir
Recursive readdir for Node.js using graceful-fs to access the file system. Supports wildcards for selective listing.
Installation
$ npm install gerard
Usage
var gerard = ; ;
Arguments
path
A string or an array of strings representing paths to be read. Supports wildcards (see examples).
options
Optional object containing configuration options.
Available options:
- ignore (String|Array.) - a pattern/an array of patterns used to exclude files/paths from reading, supports globstar matching.
- stats (Boolean) - return file objects containing file's statistics (see: fs.Stats)
- stopOnErrors (Boolean) - set to
false
if you don't want Gerard to stop on the first error. Defaults totrue
.
callback
A Node-style callback function called when done reading or an error occurred.
Examples
Get a list of all files in the given directory:
;
Ignore all JavaScript files:
;
Get files and its' statistics:
;
Use wildcards for the path:
;
Tests
$ npm test
License
MIT, for license details see: LICENSE.md.