Atomic file operations for backup system.
- Source
Methods
(async, inner) atomicWrite(targetPath, content) → {Promise.<void>}
Writes content atomically via temp file + rename
Parameters:
| Name | Type | Description |
|---|---|---|
targetPath | string | |
content | string |
- Source
Returns:
- Type:
- Promise.<void>
(inner) atomicWriteSync(targetPath, content)
Parameters:
| Name | Type | Description |
|---|---|---|
targetPath | string | |
content | string |
- Source
(async, inner) copyFilePreservingStructure(srcFile, destRoot, cwd) → {Promise.<{original: string, backup: string, size: number}>}
Copies file preserving directory structure relative to cwd
Parameters:
| Name | Type | Description |
|---|---|---|
srcFile | string | |
destRoot | string | |
cwd | string |
- Source
Returns:
- Type:
- Promise.<{original: string, backup: string, size: number}>
(inner) copyFilePreservingStructureSync(srcFile, destRoot, cwd) → {Object}
Parameters:
| Name | Type | Description |
|---|---|---|
srcFile | string | |
destRoot | string | |
cwd | string |
- Source
Returns:
- Type:
- Object
(async, inner) ensureDir(dirPath) → {Promise.<void>}
Parameters:
| Name | Type | Description |
|---|---|---|
dirPath | string |
- Source
Returns:
- Type:
- Promise.<void>
(inner) ensureDirSync(dirPath)
Parameters:
| Name | Type | Description |
|---|---|---|
dirPath | string |
- Source
(async, inner) listDirs(parentDir) → {Promise.<Array.<string>>}
Parameters:
| Name | Type | Description |
|---|---|---|
parentDir | string |
- Source
Returns:
- Type:
- Promise.<Array.<string>>
(inner) listDirsSync(parentDir) → {Array.<string>}
Parameters:
| Name | Type | Description |
|---|---|---|
parentDir | string |
- Source
Returns:
- Type:
- Array.<string>
(async, inner) removeDir(dirPath) → {Promise.<void>}
Parameters:
| Name | Type | Description |
|---|---|---|
dirPath | string |
- Source
Returns:
- Type:
- Promise.<void>
(inner) removeDirSync(dirPath)
Parameters:
| Name | Type | Description |
|---|---|---|
dirPath | string |
- Source
(async, inner) restoreFile(backupPath, originalPath) → {Promise.<void>}
Parameters:
| Name | Type | Description |
|---|---|---|
backupPath | string | |
originalPath | string |
- Source
Returns:
- Type:
- Promise.<void>
(inner) restoreFileSync(backupPath, originalPath)
Parameters:
| Name | Type | Description |
|---|---|---|
backupPath | string | |
originalPath | string |
- Source