@fensziii/readdirrecursive
v1.0.7
Published
Node JS - readdirRecursive - async/await
Downloads
6
Maintainers
Readme
nodejs - readdirRecursive
read dir recursively
npm package @fensziii/readdirrecursive.
Supported Node versions
10.x = Unsupported
12.x = Supported
14.x = Supported
Install
npm i @fensziii/readdirrecursive
or
npm i @fensziii/readdirrecursive --save
Example
var rdr = require("@fensziii/readdirrecursive")
const path = require("path");
(async () => {
const options = {
path : path.join(__dirname),
fullpath : false,
filter : /(.js$)/g // or new RegExp(".js$", "g")
};
const files = await rdr.readdirRecursive(options).catch((err) => { console.error(err); });
console.info(files);
})();
Output
{
files : ["index.js", "tests/test.js"],
folders : ["tests"],
info : {
time : 51,
path : "",
files : 2,
folders : 1,
size : 30532,
converted : {
size : '29.82 KB',
time : '00:00:00.051'
}
}
}
Changelog
1.0.7
- Fix fullpath
- Filter changed to RegExp
License
MIT