require all files in directory nodejs code example
Example 1: node get all files in folder
fs.readdir('./', (err, files) => {
files.forEach(file => {
// console.log(file);
})});
Example 2: how to read all files in a folder in node js
fs.readdir('./', (err, files) => {
files.forEach(file => {
// console.log(file);
}});