Directory tree traversal in nodejs
$ npm install @spatocode/dirwalk
const dirwalk = require("@spatocode/dirwalk");
// Asynchronous function
dirwalk.walk("path/to/dir", (err, path, info) => {
if (err) {
throw err;
}
console.log(path, " : ", info.size);
});
// Synchronous function
var files = dirwalk.walkSync("path/to/dir");
console.log(files);
MIT License Copyright (c) 2019 Ekene Izukanne