(filePath, newFilePath, mode)
| 41 | }) |
| 42 | } |
| 43 | function copyFileSync(filePath, newFilePath, mode) { |
| 44 | fs.copyFileSync(filePath, newFilePath, mode, err => { |
| 45 | if (err) { |
| 46 | throw new Error(`文件复制失败${filePath} -> ${newFilePath}`) |
| 47 | } |
| 48 | }) |
| 49 | } |
| 50 | |
| 51 | export { createFile, writeFile, appendFile, appendFileSync, readFileSync, renameFileSync, copyFileSync } |