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
function walk(
root?: string,
includeFolders?: boolean,
): AsyncIterableIterator<string>;
root
: Path to where the search starts. Defaults to .
.
includeFolders
: If paths of folders should be returned. Defaults to false
.
The function is an async generator that yields the paths of the files recursively.
Development
Full tests with coverage
npm test
Unit tests and watch for changes
npm run unit-test
License
MIT License