Skip to content

UseCopyFile

katanakit-js / useCopyFile

function useCopyFile(
source,
destination,
options?,
): Promise<FilesystemResult<string>>;

Defined in: infrastructure/filesystem/filesystem.service.ts:432

Copies a file. Existing destinations are overwritten unless overwrite: false is passed (COPYFILE_EXCL).

Parameter Type Description
source string Source file path.
destination string Destination file path.
options? { overwrite?: boolean; } Set overwrite: false to fail when the target exists.
options.overwrite? boolean -

Promise<FilesystemResult<string>>

Safe Result with the destination path.

await useCopyFile("data/books.json", "backup/books.json");