Walk
Simple node module to transverse files recursively.
Installation
npm install @fcostarodrigo/walk
Usage
const walk = require("@fcostarodrigo/walk");
async function main() {
for await (const file of walk()) {
console.log(file);
}
}
main();
Documentation
walk(root, lisFolders, walkFolder);
root
: Optional folder to transverse. Defaults to .
.
includeFolders
: Optional flag to list folders. Defaults to false
.
walkFolder
: Optional callback to decide if a folder is going to be transversed.
The function is an async generator that yields the paths of the files recursively.
Changelog
License
MIT License