+5
-2
@@ -31,3 +31,3 @@ 'use strict'; | ||
| } | ||
| function copyDir(source, dest, limit = 6) { | ||
| function copyDir(source, dest, limit) { | ||
| const list = readdirSyncRecursive__default(source); | ||
@@ -40,5 +40,8 @@ const files = list.filter((l) => isFile(nodePath__default.join(source, l))); | ||
| fs__default.mkdirSync(destPath, { recursive: true }); | ||
| copyDir(nodePath__default.join(source, dir), destPath, limit); | ||
| copyDir(nodePath__default.join(source, dir), destPath, void 0); | ||
| } | ||
| } | ||
| if (typeof limit !== "number" || !files.length) { | ||
| return; | ||
| } | ||
| async__default.eachLimit(files, limit, (file, next) => { | ||
@@ -45,0 +48,0 @@ const srcPath = nodePath__default.join(source, file); |
+2
-2
@@ -5,6 +5,6 @@ /** | ||
| * @param dest destination directory | ||
| * @param limit the max number of open files one time(default 6) | ||
| * @param limit the max number of open files at a time | ||
| */ | ||
| declare function copyDir(source: string, dest: string, limit?: number): void; | ||
| declare function copyDir(source: string, dest: string, limit: number | undefined): void; | ||
| export { copyDir as default }; |
+2
-2
@@ -5,6 +5,6 @@ /** | ||
| * @param dest destination directory | ||
| * @param limit the max number of open files one time(default 6) | ||
| * @param limit the max number of open files at a time | ||
| */ | ||
| declare function copyDir(source: string, dest: string, limit?: number): void; | ||
| declare function copyDir(source: string, dest: string, limit: number | undefined): void; | ||
| export { copyDir as default }; |
+2
-2
@@ -5,6 +5,6 @@ /** | ||
| * @param dest destination directory | ||
| * @param limit the max number of open files one time(default 6) | ||
| * @param limit the max number of open files at a time | ||
| */ | ||
| declare function copyDir(source: string, dest: string, limit?: number): void; | ||
| declare function copyDir(source: string, dest: string, limit: number | undefined): void; | ||
| export { copyDir as default }; |
+5
-2
@@ -22,3 +22,3 @@ import async from 'async'; | ||
| } | ||
| function copyDir(source, dest, limit = 6) { | ||
| function copyDir(source, dest, limit) { | ||
| const list = readdirSyncRecursive(source); | ||
@@ -31,5 +31,8 @@ const files = list.filter((l) => isFile(nodePath.join(source, l))); | ||
| fs.mkdirSync(destPath, { recursive: true }); | ||
| copyDir(nodePath.join(source, dir), destPath, limit); | ||
| copyDir(nodePath.join(source, dir), destPath, void 0); | ||
| } | ||
| } | ||
| if (typeof limit !== "number" || !files.length) { | ||
| return; | ||
| } | ||
| async.eachLimit(files, limit, (file, next) => { | ||
@@ -36,0 +39,0 @@ const srcPath = nodePath.join(source, file); |
+1
-1
| { | ||
| "name": "cpr-dir", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "Copy directory recursively like `cp -r` command", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+1
-1
@@ -16,3 +16,3 @@ # cpr-dir | ||
| // like `cp -r /path/source /path/destination` | ||
| copyDir('/path/source', '/path/destination') | ||
| copyDir('/path/source', '/path/destination', 6) | ||
| ``` |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
6926
2%102
6.25%0
-100%