1.0.7 • Published 4 years ago

@fensziii/readdirrecursive v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

nodejs - readdirRecursive

Build Status npm package

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

1.0.7

4 years ago

1.0.6

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.5

4 years ago