get all files in directory and subdirectories nodejs code example
Example 1: javascript get list of files in directory
var fs = require('fs');
var files = fs.readdirSync('/downloads');
Example 2: get all from dir node
const getAllFromDir = source =>
fs.readdirSync(source).map(name => path.join(source, name));
console.log(getDirectories("C:/"));