Skip to content

fensziii/readdirRecursive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
    };

    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

About

Node JS - readdirRecursive - async/await

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published