Answers for "check directory folders in node js"

9

read directory in node js

const testFolder = './tests/';
const fs = require('fs');

fs.readdir(testFolder, (err, files) => {
  files.forEach(file => {
    console.log(file);
  });
});
Posted by: Guest on April-09-2021
3

fs check if dir is dir

fs.lstatSync(path_string).isDirectory()
Posted by: Guest on June-05-2021

Code answers related to "check directory folders in node js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language