Obtenez tout du nœud DIR
const getAllFromDir = source =>
fs.readdirSync(source).map(name => path.join(source, name));
console.log(getDirectories("C:/"));
Jules
const getAllFromDir = source =>
fs.readdirSync(source).map(name => path.join(source, name));
console.log(getDirectories("C:/"));
const { readdirSync } = require('fs')
const getDirectories = source =>
readdirSync(source, { withFileTypes: true })
.filter(dirent => dirent.isDirectory())
.map(dirent => dirent.name)