Answers for "which method of node fs module is used to read directory"

3

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

Code answers related to "which method of node fs module is used to read directory"

Code answers related to "Javascript"

Browse Popular Code Answers by Language