Answers for "nodejs get all folders in directory"

1

get all from dir node

const getAllFromDir = source =>
      fs.readdirSync(source).map(name => path.join(source, name));
      console.log(getDirectories("C:/"));
Posted by: Guest on October-06-2020
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 folders in directory"

Code answers related to "Javascript"

Browse Popular Code Answers by Language