Answers for "node js get all file names in directory"

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

how to get file name in directory node js

const path = require('path')

//...

//inside the `for` loop
const stat = fs.lstatSync(path.join(dir, file))
Posted by: Guest on October-16-2020

Code answers related to "node js get all file names in directory"

Code answers related to "Javascript"

Browse Popular Code Answers by Language