Answers for "get all file names in a directory javascript"

6

node get all files in folder

fs.readdir('./', (err, files) => {
    files.forEach(file => {
    //   console.log(file);
})});
Posted by: Guest on March-15-2021
2

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

Code answers related to "get all file names in a directory javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language