3.0.4 • Published 4 years ago
rfc-walk v3.0.4
RFC-WALK
Simple node module to transverse files recursively.
DEPRECATED: See @fcostarodrigo/walk
Installation
npm install rfc-walk
Usage
const walk = require("rfc-walk");
for (const file of await walk()) {
console.log(file);
}
await walk({ onPath: console.log });
walk().then(console.log);
Documentation
function walk(options?: {
root?: string;
includeFolders?: boolean;
onPath?: (path: string) => Promise<void> | undefined;
}): Promise<string[]>;
root
: Path to where start the search.includeFolders
: If paths of folders should be returned.onPath
: Called with each path found. If it returns a promise, walk will wait for it to resolve.- Returns a promise that resolves after the search is finished and it is resolved with a list of paths if onPath is not passed.
Development
Full tests with coverage
npm test
Unit tests and watch for changes
npm run unit-test