javscript get all files in folder code example
Example 1: node get all files in folder
fs.readdir('./', (err, files) => {
files.forEach(file => {
// console.log(file);
})});
Example 2: javascript get list of files in directory
var fs = require('fs');
var files = fs.readdirSync('/downloads');