Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get all files in directory recursively nodejs

// You can use a globbing lib
const glob = require("glob");

var getDirectories = function (src, callback) {
  glob(src + '/**/*', callback);
};
getDirectories('test', function (err, res) {
  if (err) {
    console.log('Error', err);
  } else {
    console.log(res);
  }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #files #directory #recursively #nodejs
ADD COMMENT
Topic
Name
9+5 =