You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
579 B
26 lines
579 B
4 years ago
|
'use strict';
|
||
|
|
||
|
module.exports = readdirStream;
|
||
|
|
||
|
const DirectoryReader = require('../directory-reader');
|
||
|
|
||
|
let streamFacade = {
|
||
|
fs: require('fs'),
|
||
|
forEach: require('../async/for-each'),
|
||
|
async: true
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Returns the {@link stream.Readable} of an asynchronous {@link DirectoryReader}.
|
||
|
*
|
||
|
* @param {string} dir
|
||
|
* @param {object} [options]
|
||
|
* @param {object} internalOptions
|
||
|
*/
|
||
|
function readdirStream (dir, options, internalOptions) {
|
||
|
internalOptions.facade = streamFacade;
|
||
|
|
||
|
let reader = new DirectoryReader(dir, options, internalOptions);
|
||
|
return reader.stream;
|
||
|
}
|