1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/@mrmlnc/readdir-enhanced/lib/stream/index.js

26 lines
579 B
JavaScript
Raw Permalink Normal View History

2023-12-18 13:12:25 +08:00
'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;
}