Answers for "how to add all files in a director to an array in javascript"

0

how to add all files in a director to an array in javascript

const testFolder = '/public/images/';
const fs = require('fs');
fs.readdir(testFolder, (err, files) => {
  files.forEach(file => {
    console.log(file);
  });
})
Posted by: Guest on April-29-2022

Code answers related to "how to add all files in a director to an array in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language