readdirs
Read several directories at once asynchronously
Installation
npm install --save readdirs
Summary
This module is essentially a convenience wrapper for using async in combination with fs.readdir
. It reads the directories you pass it and concatenates and sorts the results.
Usage
Require readdirs
and pass an array of directories (relative to pwd, as with fs.readdir
), optionally an options object, and a callback, and you'll get an optional error and the list of files back.
The default usage returns only the file name, as readdir does.
var readdirs = ; ;
But you can also request absolute paths if you need to be able to sort out which ones are in which directory.
var readdirs = ; ;
Or you can leave the arrays unmerged (i.e. an array of arrays instead of file names).
var readdirs = ; ;
And of course, you could combine these options as well.
Contributing
Please see the contribution guidelines.