🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

cpr-dir

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cpr-dir - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+5
-2
dist/index.cjs

@@ -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);

@@ -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,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,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 };

@@ -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);

{
"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",

@@ -16,3 +16,3 @@ # cpr-dir

// like `cp -r /path/source /path/destination`
copyDir('/path/source', '/path/destination')
copyDir('/path/source', '/path/destination', 6)
```