Answers for "how to get a list of all files in a directory javascript"

3

Get List of all files in a 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
1

javascript get list of files in directory

var fs = require('fs');
var files = fs.readdirSync('/downloads');
Posted by: Guest on December-08-2020

Code answers related to "how to get a list of all files in a directory javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language