Methods
(async) copyItem(source, destination, depth, height, flatten, conflictResolution, logLevel, currentDepthopt) → {Promise.<void>}
Recursively copies a file or folder with configurable logging.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
source |
string | Path to the source file or folder. |
||
destination |
string | Destination path. |
||
depth |
number | Maximum copy depth. |
||
height |
number | Maximum copy height. |
||
flatten |
boolean | Whether to flatten directory structure. |
||
conflictResolution |
'overwrite' | 'skip' | 'rename' | Conflict resolution strategy. |
||
logLevel |
'none' | 'verbose' | 'brief' | Logging level. |
||
currentDepth |
number |
<optional> |
0 | Current nesting depth. |
Returns:
- Type
- Promise.<void>
formatPath(filePath) → {string}
Formats file path for brief logging
Parameters:
Name | Type | Description |
---|---|---|
filePath |
string | Path to format |
Returns:
- Formatted path
- Type
- string
(async) getUniqueFileName(filePath) → {Promise.<string>}
Generates a unique filename by adding a suffix if the file already exists.
Parameters:
Name | Type | Description |
---|---|---|
filePath |
string | Original path to the file. |
Returns:
- Unique filename.
- Type
- Promise.<string>
logBrief(operation, filePath, destPathopt)
Logs operation in brief format
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
operation |
string | Operation type |
||
filePath |
string | File path |
||
destPath |
string |
<optional> |
null | Destination path for copy operations |