1const getAllFromDir = source =>
2 fs.readdirSync(source).map(name => path.join(source, name));
3 console.log(getDirectories("C:/"));
1const { readdirSync } = require('fs')
2
3const getDirectories = source =>
4 readdirSync(source, { withFileTypes: true })
5 .filter(dirent => dirent.isDirectory())
6 .map(dirent => dirent.name)