more-node-fs
Advanced tools
Comparing version 1.2.5 to 1.2.6
@@ -28,3 +28,3 @@ /// <reference types="node" /> | ||
*/ | ||
export declare function forEachPath(path: string, callback: (path: string, stats: fs.Stats) => void, options?: PathOptions): Promise<void>; | ||
export declare function forEachPath(path: string, callback: (path: string, stats: fs.Stats) => void | Promise<void>, options?: PathOptions): Promise<void>; | ||
/** | ||
@@ -31,0 +31,0 @@ * Synchronously loop through all paths found in or at the path parameter. This function is |
@@ -37,2 +37,3 @@ "use strict"; | ||
return; | ||
const promises = []; | ||
const stats = yield stat(path); | ||
@@ -44,5 +45,6 @@ if (stats.isDirectory()) { | ||
for (const pathInDir of dir) | ||
yield forEachPath(path_1.join(path, pathInDir.toString()), callback, options); | ||
promises.push(forEachPath(path_1.join(path, pathInDir.toString()), callback, options)); | ||
} | ||
yield callback(path, stats); | ||
promises.push(callback(path, stats)); | ||
yield Promise.all(promises); | ||
}); | ||
@@ -49,0 +51,0 @@ } |
{ | ||
"name": "more-node-fs", | ||
"version": "1.2.5", | ||
"version": "1.2.6", | ||
"description": "A utility which adds some more File System functions for Node.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18865
306