Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return subfiles in paths.dirs #56

Open
ridhwaans opened this issue Mar 11, 2018 · 0 comments
Open

Return subfiles in paths.dirs #56

ridhwaans opened this issue Mar 11, 2018 · 0 comments

Comments

@ridhwaans
Copy link

ridhwaans commented Mar 11, 2018

Is there a way to iterate the files in the paths.dirs returned by node-dir? It also returns paths.files but they are not necessarily in the same subdir

I want to avoid rereading dirs like:

 ...
root_dir.subdirs(__dirname, function(err, subdirs) { // read root_dir
    if (err) throw err;
    map(subdirs, function(dir){ // for each dir in subdirs
    fs.readdir( dir, function( err, files ) { // read dir
            if(err) console.log(err)
            files.forEach( function( file, index ) {
            ...
@ridhwaans ridhwaans changed the title For each file in paths.dirs Return subfiles in paths.dirs Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant