javascript - Recursive directory search including files inside ZIP's and RAR's -


i'm trying find solution problem. need files inside target directory, including files inside zip , rars. possible? i'm working version, takes files inside directories, including zips , rars files, not inside.

var fs = require('fs'); var path = require('path'); var walk = function(dir, done) {   var results = [];   fs.readdir(dir, function(err, list) {     if (err) return done(err);     var pending = list.length;     if (!pending) return done(null, results);     list.foreach(function(file) {       file = path.resolve(dir, file);       fs.stat(file, function(err, stat) {         if (stat && stat.isdirectory()) {           walk(file, function(err, res) {             results = results.concat(res);             if (!--pending) done(null, results);           });         } else {           results.push(file);           if (!--pending) done(null, results);         }       });     });   }); }; 

thanks in advance.

while recursively looking file,if zip file can use module adm-zip getentries of zip file , recursive search again.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -