Answers for "nodejs get all from folder"

6

node get all files in folder

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

nodejs get all folders in directory

const { readdirSync } = require('fs')

const getDirectories = source =>
  readdirSync(source, { withFileTypes: true })
    .filter(dirent => dirent.isDirectory())
    .map(dirent => dirent.name)
Posted by: Guest on October-03-2021

Code answers related to "nodejs get all from folder"

Code answers related to "Javascript"

Browse Popular Code Answers by Language